/ SeriousOJ /

Record Detail

Compile Error

foo.c: In function 'main':
foo.c:5:17: error: 't' undeclared (first use in this function)
    5 |     scanf("%d",&t);
      |                 ^
foo.c:5:17: note: each undeclared identifier is reported only once for each function it appears in

Code

#include<stdio.h>
#include<string.h>
int main(){
    int n;
    scanf("%d",&t);
    for(int i=0;i<n;i++){
    char str[100];
    gets(str);
    int p=0;
    int q=0;
    for(int i=0;str[i]!='\0';i++){
        if(str[i]=='p'){
          p++; 
        }else{
          q++;
        }
    }
    if(p>q){
        printf("Roy\n");
    }else if(p<q){
        printf("Mahfuj\n");
    }else{
      printf("Draw");
    }
    }
    
   return 0;
}

Information

Submit By
Type
Submission
Problem
P1040 Character game
Contest
TLE_Headquarters - round #1
Language
C99 (GCC 13.2.0)
Submit At
2024-03-27 18:03:21
Judged At
2024-11-11 03:37:20
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes