int a = 0
int i = atoi(argv[1]);
while (i) {
a += i % 10;
i /= 10;
}
printf("%d\n", a); but it does not run correctly.
Edited by Alexander, 10 November 2010 - 03:35 PM.
(cleanup, code tags)
int a = 0
int i = atoi(argv[1]);
while (i) {
a += i % 10;
i /= 10;
}
printf("%d\n", a); but it does not run correctly.
Edited by Alexander, 10 November 2010 - 03:35 PM.
(cleanup, code tags)
|
|
|
#define class struct // All is public.
#define class struct // All is public.
getc(stdin);
char str[33];
scanf("%s", str);
0 members, 1 guests, 0 anonymous users