fork download
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int tab[1000]
  5. for(int i=0;i<1000;i++)
  6. {
  7. tab[i]=0;
  8. for(int k=1;k<i+1;k++)
  9. if((i+1)%k==0)tab[i]+=k;
  10. }
  11. printf("Liczby doskonale to %d ",dosk(tab[1000]));
  12. }
  13.  
  14. int dosk(int tab[])
  15. {
  16. for(inti=0;i<1000;i++)
  17. if(i+1==tab[i])return i+1;
  18. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:5:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
  for(int i=0;i<1000;i++)
  ^
prog.c:7:3: error: 'tab' undeclared (first use in this function)
   tab[i]=0;
   ^
prog.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
prog.c:11:34: warning: implicit declaration of function 'dosk' [-Wimplicit-function-declaration]
 printf("Liczby doskonale to %d ",dosk(tab[1000]));
                                  ^
prog.c: In function 'dosk':
prog.c:16:6: error: 'inti' undeclared (first use in this function)
  for(inti=0;i<1000;i++)
      ^
prog.c:16:13: error: 'i' undeclared (first use in this function)
  for(inti=0;i<1000;i++)
             ^
prog.c:18:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
stdout
Standard output is empty