为什么说我“Presentation error”,求大神指点!!
描述You are ordered to count the number of coins in the government treasury. To make the job more interesting you decide to say “Dead” for all numbers that are a multiple of 3 and “Man” for all numbers that are a multiple of 5. For numbers that are multiples of both 3 and 5 you say “DeadMan”
输入
The input will be the number of coins you need to count.
输出
The output will be the numbers and words in sequence, separated by spaces. Start a new line after each word.
样例输入
18
样例输出
1 2 Dead
4 Man
Dead
7 8 Dead
Man
11 Dead
13 14 DeadMan
16 17 Dead
我的代码:
#include <stdio.h>
int main()
{
int a,b,c,i=1;
scanf("%d",&a);
while(a>=i)
{
if(i%3==0&&i%5!=0)
printf("Dead\n");
if(i%3!=0&&i%5==0)
printf("Man\n");
if(i%3==0&&i%5==0)
printf("DeadMan\n");
if(i%3!=0&&i%5!=0)
printf("%d ",i);
i++;
}
return 0;
}
为什么说我“Presentation error”,求大神指点!!