it means, process the input till End Of File. while there is two more long long data in the input file,process it. otherwise, terminate the program. you can do it the following way too... while(scanf("%lld %lld", &a, &b)!=EOF)
we need long long int for 2^32. 2^32 = 4294967296. int range is -32767, +32767 .So, int not capable of containing 2^32. but long long int rang is −9223372036854775807, +9223372036854775807. thats why we have to use long long int for 2^32.
when i use this code.. #include #include int main() { int a,b,c; while(scanf("%d%d",&a,&b)!=EOF) { c=abs(a-b); printf("%d\n",c); } return 0; } it shows wrong ans in uva what's the problem here.
(scanf("%lld%lld",&a,&b)==2 what does the condition mean?
ReplyDeleteit means, process the input till End Of File. while there is two more long long data in the input file,process it. otherwise, terminate the program.
Deleteyou can do it the following way too...
while(scanf("%lld %lld", &a, &b)!=EOF)
what difference does this statement makes?
Deletethanks bro
ReplyDelete#include
ReplyDeleteint main()
{
int x,y;
while (scanf("%d %d", &x, &y)==2)
{
if (x>y)
printf("%d/n", x-y);
else
printf("%d/n", y-x);
}
return 0;
}
#include
ReplyDeleteint main()
{
int x,y;
while (scanf("%d %d", &x, &y)==2)
{
if (x>y)
printf("%d/n", x-y);
else
printf("%d/n", y-x);
}
return 0;
}
where is the condition for " input is not greater than 2^32 " ???
ReplyDeletewe need long long int for 2^32.
Delete2^32 = 4294967296. int range is -32767, +32767 .So, int not capable of containing 2^32. but long long int rang is −9223372036854775807, +9223372036854775807.
thats why we have to use long long int for 2^32.
#include
ReplyDeleteint main()
{
int i,j,k,diff;
for(k=0;k>=0;k++)
{
scanf("%d",&i);
scanf("%d",&j);
printf("\n");
if(i<j)
{
diff=j-i;
printf("%d",diff);
printf("\n");
}
}
return 0;
}
if i make this code,then whatis the prblm?
when i use this code..
ReplyDelete#include
#include
int main()
{
int a,b,c;
while(scanf("%d%d",&a,&b)!=EOF)
{
c=abs(a-b);
printf("%d\n",c);
}
return 0;
}
it shows wrong ans in uva what's the problem here.
why I can not run in cmd this file what is problem
ReplyDelete.................
ReplyDeletemagverdescyo Judy Reuland https://wakelet.com/wake/GS3i45tuMv4p1z6spivVz
ReplyDeleteteaupetifens
innegPit-gu-1984 Brian Hunt https://www.synergyhandf.com/profile/altayreidaenaidaena/profile
ReplyDeletefragleninan
Nnoguprocne Ruth Gray download
ReplyDeletehttps://colab.research.google.com/drive/1UsD0P0T9hREHqn6c3oCDR4x1b6cYxdGS
download
click
cosnoserna
globis0ter-e Leah Lundwall 4K Video Downloader
ReplyDeleteGoogle Chrome browser
Avast Cleanup
penanwoodbhou