Page 1 of 1

scanf("%I64d",&p);

Posted: Wed Jun 29, 2005 9:13 am
by Sid337
I can't anderstand what's going on! My program is :
#include <stdio.h>
int main()
{
__int64 p,k,m=0;
scanf("%I64d",&p);
...........................
printf("%I64d",m);
return 0;
}

And I got Compile error! I think i've got problem with input/ output please help... what I am to change?
javascript:emoticon(':(')


:( :( :( :( :( :( :( :( :(

Posted: Wed Jun 29, 2005 9:18 am
by chunyi81
Hi, UVA OJ uses g++ in linux, which supports long long for 64bit integers but not __int64. I suppose you are using a C++ programming IDE in Windows?

Use long long instead of __int64 and scanf("%lld",&p), printf("%lld,m)
or scanf("%Ld",&p), printf("%Ld,m)

Do browse the forum for threads related to your problem before posting next time.

Posted: Wed Jun 29, 2005 11:00 am
by Sid337
:D
Thank you, very much!!!!

Posted: Tue Jun 12, 2012 3:54 pm
by kanhabhu
import java.util.Scanner;
public class java4
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);

int n=sc.nextInt();
int i,j,d=0,t=0;
float c;
long a[]=new long[n];
long b[]=new long[n];

for( i=0;i<n;i++)
a=sc.nextLong();
for(i=0;i<n;i++)
{
c=0f;
for(j=0;j<n;j++)
{
if(i!=j)
c+=a[j];
}
c=(float)c/(n-1);
if(a==c)
{
d++;
b[t++]=i+1;

}

}


System.out.println(d);
for(i=0;i<d;i++)
System.out.print(b+" ");


}


}
//whats wrong in it ??gives error on 10th test during runtime..plz help

Re: scanf("%I64d",&p);

Posted: Tue Jun 12, 2012 11:34 pm
by brianfry713
What's the problem number? Why did you post this here?