总是出现presentation 错误。。原来每行中只有两个输出之间才能有一个空格,
#include <stdio.h> void verify(int n) { int flag = 0; while(n != 1) { if(n % 2 ==0) n = n / 2; else { if(flag != 0 ) printf(" "); printf("%d",n); n = n * 3 + 1; flag++; } } if(flag == 0) printf("No number can be output !\n"); else printf("\n"); } int main() { int n; int num; int i; while(scanf("%d", &n) == 1) { for(i = 0; i < n ; i++) { scanf("%d", &num); verify(num); } } return 0; }