为什么只有90
查看原帖
为什么只有90
1136011
xuyang123楼主2023/10/12 19:40
#include<stdio.h>
int main()
{
	int x,m;
	char a;
	scanf("%d %c",&x,&a);
	if(x<=1000&&a=='n'){
		m = 8;
	} else if(x<=1000&&a=='y'){
		m = 13;
	} else if(x>1000&&a=='n'){
		if((x-1000)%500!=0&&x-1000<500){
			m = 12;
		} else {
			m = 8+4*((x-1000)/500)+4;
		}
	} else if(x>1000&&a=='y'){
		if((x-1000)%500==0&&x-1000<500){
			m = 17;
		} else {
			m = 8+4*((x-1000)/500)+4+5;
		}
	}
	printf("%d",m);
	return 0;
}
2023/10/12 19:40
加载中...