csp小明上学--c语言代码

#include<stdio.h>

int main(){
	int r,y,g;
	int n,k,t;
    int ans=0;//求累计时间 
    scanf("%d%d%d",&r,&y,&g);
    scanf("%d",&n);
    while(n--){
    	scanf("%d%d",&k,&t);
    	if(k==0) ans+=t;	
    	else if (k==1) ans+=t;
    	else if(k==2) ans+= t+r;
    
	}
    printf("%d",ans);
    return 0;

}


csp小明上学--c语言代码

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-09
  • 2021-05-31
  • 2022-12-23
  • 2021-11-04
  • 2021-06-03
  • 2021-10-27
  • 2022-02-11
相关资源
相似解决方案