fork download
  1. #include <stdio.h>
  2. #include<string.h>
  3.  
  4. int main(void){
  5.  
  6. int len,i;
  7. char str1[256],str2[]="DRAGONQUEST";
  8.  
  9. scanf_s("%s",str1);
  10.  
  11. len=strlen(str2);
  12.  
  13. for(i=0;i<len+1;++i){
  14. if(str1[i]!=str2[i])break;
  15. }
  16.  
  17. if(i==len+1){
  18. printf("同じ\n");
  19. }else{
  20. printf("違う\n");
  21. }
  22.  
  23.  
  24. return 0;
  25. }
  26.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:5: warning: implicit declaration of function ‘scanf_s’ [-Wimplicit-function-declaration]
     scanf_s("%s",str1);
     ^~~~~~~
/home/Mjh578/cck2vCoW.o: In function `main':
prog.c:(.text.startup+0x30): undefined reference to `scanf_s'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty