data type... (long int, long long int)
Posted: Sun Jul 16, 2006 5:57 am
hi,
i don't know how 'long long int' work.
for example,
i hava input...
gives output
now, it gives output,
the first code use 'long long int' and secode cod use 'long int'
other things equal, in both code.
but the output is different.
of course, second one is right.
and first output is quite strange for me... i can't understand...
can anybody help me?...
i don't know how 'long long int' work.
for example,
i hava input...
and first code,1 2
3 4
5 6
7 8
Code: Select all
#include <stdio.h>
int main()
{
long long int a, b;
while (scanf ("%lld%lld",&a, &b)!=EOF){
printf("%lld %lld\n", a, b);
}
return 0;
and second code,1 0
3 0
5 0
7 0
Code: Select all
#include <stdio.h>
int main()
{
long int a, b;
while (scanf ("%ld%ld",&a, &b)!=EOF){
printf("%ld %ld\n", a, b);
}
return 0;
}
1 2
3 4
5 6
7 8
the first code use 'long long int' and secode cod use 'long int'
other things equal, in both code.
but the output is different.
of course, second one is right.
and first output is quite strange for me... i can't understand...
can anybody help me?...