#include <stdio.h> #include <string.h> #include <time.h> char md[100],mv[100]; int s,p=15,i,k,z,t; int main(){ srand(file(NULL)); s=rand()%22; if(s==0) md='AIST'; if(s==1) md='KOZA' if(s==2) md='MAMA'; if(s==3) md='PAPA'; if(s==4) md='BRAT'; if(s==5) md='MYLO'; if(s==6) md='ROZA'; if(s==7) md='KOFE'; if(s==8) md='NOGA'; if(s==9) md='NOTA'; if(s==10) md='VAZA'; if(s==11) md='BANT'; if(s==12) md='SALO'; if(s==13) md='SOVA'; if(s==14) md='KRAN'; if(s==15) md='VODA'; if(s==16) md='BAYT'; if(s==17) md='PILA'; if(s==18) md='KOLA'; mv='____'; do{ printf("\n%c\nPoints %i\nVvedite bukvu: ",mv,p); scanf("%c",&k); t=0; for(i=0;i<4;i++) if(k==md[i]){ mv[i]=k; t=1; z++; } if(t==0) p--;} while(p>0&&z<4); if(p==0) printf("Lose"); else printf("Win"); return 0; }
Standard input is empty
prog.cpp:9:13: warning: multi-character character constant [-Wmultichar]
if(s==0) md='AIST';
^
prog.cpp:10:13: warning: multi-character character constant [-Wmultichar]
if(s==1) md='KOZA'
^
prog.cpp:11:13: warning: multi-character character constant [-Wmultichar]
if(s==2) md='MAMA';
^
prog.cpp:12:13: warning: multi-character character constant [-Wmultichar]
if(s==3) md='PAPA';
^
prog.cpp:13:13: warning: multi-character character constant [-Wmultichar]
if(s==4) md='BRAT';
^
prog.cpp:14:13: warning: multi-character character constant [-Wmultichar]
if(s==5) md='MYLO';
^
prog.cpp:15:13: warning: multi-character character constant [-Wmultichar]
if(s==6) md='ROZA';
^
prog.cpp:16:13: warning: multi-character character constant [-Wmultichar]
if(s==7) md='KOFE';
^
prog.cpp:17:13: warning: multi-character character constant [-Wmultichar]
if(s==8) md='NOGA';
^
prog.cpp:18:13: warning: multi-character character constant [-Wmultichar]
if(s==9) md='NOTA';
^
prog.cpp:19:14: warning: multi-character character constant [-Wmultichar]
if(s==10) md='VAZA';
^
prog.cpp:20:14: warning: multi-character character constant [-Wmultichar]
if(s==11) md='BANT';
^
prog.cpp:21:14: warning: multi-character character constant [-Wmultichar]
if(s==12) md='SALO';
^
prog.cpp:22:14: warning: multi-character character constant [-Wmultichar]
if(s==13) md='SOVA';
^
prog.cpp:23:14: warning: multi-character character constant [-Wmultichar]
if(s==14) md='KRAN';
^
prog.cpp:24:14: warning: multi-character character constant [-Wmultichar]
if(s==15) md='VODA';
^
prog.cpp:25:14: warning: multi-character character constant [-Wmultichar]
if(s==16) md='BAYT';
^
prog.cpp:26:14: warning: multi-character character constant [-Wmultichar]
if(s==17) md='PILA';
^
prog.cpp:27:14: warning: multi-character character constant [-Wmultichar]
if(s==18) md='KOLA';
^
prog.cpp:29:4: warning: multi-character character constant [-Wmultichar]
mv='____';
^
prog.cpp: In function 'int main()':
prog.cpp:7:16: error: 'file' was not declared in this scope
srand(file(NULL));
^
prog.cpp:7:17: error: 'srand' was not declared in this scope
srand(file(NULL));
^
prog.cpp:8:8: error: 'rand' was not declared in this scope
s=rand()%22;
^
prog.cpp:9:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==0) md='AIST';
^
prog.cpp:10:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==1) md='KOZA'
^
prog.cpp:12:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==3) md='PAPA';
^
prog.cpp:13:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==4) md='BRAT';
^
prog.cpp:14:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==5) md='MYLO';
^
prog.cpp:15:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==6) md='ROZA';
^
prog.cpp:16:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==7) md='KOFE';
^
prog.cpp:17:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==8) md='NOGA';
^
prog.cpp:18:12: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==9) md='NOTA';
^
prog.cpp:19:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==10) md='VAZA';
^
prog.cpp:20:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==11) md='BANT';
^
prog.cpp:21:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==12) md='SALO';
^
prog.cpp:22:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==13) md='SOVA';
^
prog.cpp:23:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==14) md='KRAN';
^
prog.cpp:24:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==15) md='VODA';
^
prog.cpp:25:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==16) md='BAYT';
^
prog.cpp:26:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==17) md='PILA';
^
prog.cpp:27:13: error: incompatible types in assignment of 'int' to 'char [100]'
if(s==18) md='KOLA';
^
prog.cpp:29:3: error: incompatible types in assignment of 'int' to 'char [100]'
mv='____';
^
Standard output is empty