Search found 1 match

by kc655039
Tue Nov 15, 2011 7:53 am
Forum: Volume 113 (11300-11399)
Topic: 11332 - Summing Digits
Replies: 17
Views: 12050

Re: 11332 - Summing Digits

Does anyone know how to make it take 0.000?

It still took 0.004 with the code below.


#include <stdio.h>

int
main(int argc, char** argv) {
int g;
scanf("%d", &g);
while (g) {
g %= 9;
if (g == 0) {
g = 9;
}
printf("%d\n", g);
scanf("%d", &g);
}

return 0;
}

Go to advanced search