submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s363856525
p00017
C
#include <stdio.h> #include <string.h> int scan(char *str,int max) { int i; for(i=0;i<max;i++){ if(!strncmp(&(str[i]),"this ",5))return 1; if(!strncmp(&(str[i]),"that ",5))return 1; if(!strncmp(&(str[i]),"the ",4))return 1; if(!strncmp(&(str[i]),"this.",5))return 1; if(!strncmp(&(str[i]),"that.",5))return 1; if(!strncmp(&(str[i]),"the.",4))return 1; for(i++;;i++){ if(str[i] == ' ' || str[i] == '.'){ break; } } } return 0; } int main(){ char in[82]; int n,i; while(gets(in)!=EOF){ n = strlen(in); while(1){ for(i=0;i<n;i++){ if(in[i] !=' ' && in[i] != '.'){ in[i] = in[i] + 1; if(in[i] == 'z'+1)in[i] ='a'; } } if(scan(in,n))break; } printf("%s\n",in); } return 0; }
main.c: In function 'main': main.c:26:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 26 | while(gets(in)!=EOF){ | ^~~~ | fgets
s738268736
p00017
C
#include <stdio.h> #include <string.h> #define X 90 int scan(char *str,int max) { int i; for(i=0;i<max;i++){ if(!strncmp(&(str[i]),"this ",5))return 1; if(!strncmp(&(str[i]),"that ",5))return 1; if(!strncmp(&(str[i]),"the ",4))return 1; if(!strncmp(&(str[i]),"this.",5))return 1; if(!strncmp(&(str[i]),"that.",5))return 1; if(!strncmp(&(str[i]),"the.",4))return 1; for(i++;;i++){ if(str[i] == ' ' || str[i] == '.'){ break; } } } return 0; } int main(){ char in[82]; int n,i; while(gets(in,X,stdin)!=EOF){ n = strlen(in); while(1){ for(i=0;i<n;i++){ if(in[i] !=' ' && in[i] != '.'){ in[i] = in[i] + 1; if(in[i] == 'z'+1)in[i] ='a'; } } if(scan(in,n))break; } printf("%s\n",in); } return 0; }
main.c: In function 'main': main.c:26:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 26 | while(gets(in,X,stdin)!=EOF){ | ^~~~ | fgets
s885440754
p00017
C
#include <stdio.h> #include <string.h> #define X 90 int scan(char *str,int max) { int i; for(i=0;i<max;i++){ if(str[i]=='t'){ if(!strncmp(&(str[i]),"this ",5))return 1; if(!strncmp(&(str[i]),"that ",5))return 1; if(!strncmp(&(str[i]),"the ",4))return 1; if(!strncmp(&(str[i]),"this.",5))return 1; if(!strncmp(&(str[i]),"that.",5))return 1; if(!strncmp(&(str[i]),"the.",4))return 1; } else for(i++;;i++){ if(str[i] == ' ' || str[i] == '.'){ break; } } for(i++;;i++){ if(str[i] == ' ' || str[i] == '.'){ break; } return 0; } int main(){ char in[82]; int n,i; while(gets(in,X,stdin)!=EOF){ n = strlen(in); while(1){ for(i=0;i<n;i++){ if(in[i] !=' ' && in[i] != '.'){ in[i] = in[i] + 1; if(in[i] == 'z'+1)in[i] ='a'; } } if(scan(in,n))break; } printf("%s\n",in); } return 0; }
main.c: In function 'main': main.c:32:11: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 32 | while(gets(in,X,stdin)!=EOF){ | ^~~~ | fgets main.c: In function 'scan': main.c:49:1: error: expected declaration or statement at end of input 49 | } | ^ main.c:49:1: error: expected declaration or statement at end of input
s934741231
p00017
C
#include <stdio.h> #include <string.h> #define X 90 int scan(char *str,int max) { int i; for(i=0;i<max;i++){ if(str[i]=='t'){ if(!strncmp(&(str[i]),"this ",5))return 1; if(!strncmp(&(str[i]),"that ",5))return 1; if(!strncmp(&(str[i]),"the ",4))return 1; if(!strncmp(&(str[i]),"this.",5))return 1; if(!strncmp(&(str[i]),"that.",5))return 1; if(!strncmp(&(str[i]),"the.",4))return 1; } else for(i++;;i++){ if(str[i] == ' ' || str[i] == '.'){ break; } } for(i++;;i++){ if(str[i] == ' ' || str[i] == '.'){ break; } return 0; } int main(){ char in[82]; int n,i; while(fgets(in,X,stdin)!=EOF){ n = strlen(in); while(1){ for(i=0;i<n;i++){ if(in[i] !=' ' && in[i] != '.'){ in[i] = in[i] + 1; if(in[i] == 'z'+1)in[i] ='a'; } } if(scan(in,n))break; } printf("%s\n",in); } return 0; }
main.c: In function 'main': main.c:32:28: warning: comparison between pointer and integer 32 | while(fgets(in,X,stdin)!=EOF){ | ^~ main.c: In function 'scan': main.c:49:1: error: expected declaration or statement at end of input 49 | } | ^ main.c:49:1: error: expected declaration or statement at end of input
s253830369
p00017
C
#include<stdio.h> #include<string.h> int main() { char s[99],*p; while(gets(s)) { while(!strstr(s,"the") && !strstr(s,"this") && !strstr(s,"that")) { for(p=s; *p; p++) { if(*p>='a' && *p<='y') ++*p; else if(*p=='z') *p='a'; } } puts(s); } return 0; }
main.c: In function 'main': main.c:6:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 6 | while(gets(s)) { | ^~~~ | fgets
s195080573
p00017
C
main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} | ^~~~ main.c: In function 'main': main.c:1:29: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} main.c:1:29: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} | ^~~~~ main.c:1:29: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:60: error: implicit declaration of function 'strstr' [-Wimplicit-function-declaration] 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'strstr' +++ |+#include <string.h> 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} main.c:1:60: warning: incompatible implicit declaration of built-in function 'strstr' [-Wbuiltin-declaration-mismatch] 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} | ^~~~~~ main.c:1:60: note: include '<string.h>' or provide a declaration of 'strstr' main.c:1:75: error: invalid operands to binary | (have 'char *' and 'char *') 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ | | | | char * char * main.c:1:161: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | main(){char s[99],*p;while(~scanf("%[ a-z.]\n",s)){while(!(strstr(s,"the")|strstr(s,"this")|strstr(s,"that")))for(p=s;*p;p++)*p>96&&*p<122?++*p:*p-122||(*p=97);puts(s);}return 0;} | ^~~~ main.c:1:161: note: include '<stdio.h>' or provide a declaration of 'puts'
s301321738
p00017
C
#include <stdio.h> #include <string.h> #define MAX 80 // ˆÃ†•¶‚ÌÅ‘å•¶Žš” #define THE 0 // ”»•ʂɎg‚¤’PŒê #define THIS 1 #define THAT 2 #define SORT 3 // ”»•Ê’PŒê‚ÌŽí—Þ #define C_MAX 4 // ”»•Ê’PŒê‚ÌÅ‘å•¶Žš” #define A_NUM 26 // Žg—p•¶Žš‚̐” int main(void) { char s[MAX+1]; char CRYPT[SORT][A_NUM][C_MAX+1]; int flag; char c[MAX+1]; int i, j, k; for(i = 0; i < A_NUM; i++) { CRYPT[THE][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][2] = ('e'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][3] = '\0'; CRYPT[THIS][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][2] = ('i'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][3] = ('s'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][4] = '\0'; CRYPT[THAT][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][2] = ('a'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][3] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][4] = '\0'; } while(gets(s) != NULL) { flag = 0; j = 0; for(i = 0; i < strlen(s); i++) { if( s[i]!=' ' && s[i]!='.' ) { c[j++] = s[i]; continue; } c[j] = '\0'; j = 0; for(k = 0; k < A_NUM; k++) { if( strcmp(c, &CRYPT[THE][k][0])==0 || strcmp(c, &CRYPT[THIS][k][0])==0 || strcmp(s, &CRYPT[THAT][k][0])==0 ) { flag = 1; break; } } if(flag) { break; } } if(flag) { for(i = 0; i < strlen(s)-1; i++) { if( s[i]!=' ' && s[i]!='.' ) { if(s[i]-k >= 'a') { putchar(s[i]-k); } else { putchar(s[i]-k + A_NUM); } } else { putchar(s[i]); } } printf("\n"); } } return 0; }
main.c: In function 'main': main.c:36:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 36 | while(gets(s) != NULL) { | ^~~~ | fgets main.c:36:23: warning: comparison between pointer and integer 36 | while(gets(s) != NULL) { | ^~
s111316496
p00017
C
#include <stdio.h> #include <string.h> #define MAX 80 #define THE 0 #define THIS 1 #define THAT 2 #define SORT 3 #define C_MAX 4 #define A_NUM 26 int main(void) { char s[MAX+1]; char CRYPT[SORT][A_NUM][C_MAX+1]; int flag; char c[MAX+1]; int i, j, k; for(i = 0; i < A_NUM; i++) { CRYPT[THE][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][2] = ('e'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][3] = '\0'; CRYPT[THIS][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][2] = ('i'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][3] = ('s'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][4] = '\0'; CRYPT[THAT][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][2] = ('a'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][3] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][4] = '\0'; } while(gets(s) != NULL) { flag = 0; j = 0; for(i = 0; i < strlen(s); i++) { if( (s[i]!=' ') && (s[i]!='.') ) { c[j++] = s[i]; continue; } c[j] = '\0'; j = 0; for(k = 0; k < A_NUM; k++) { if( (strcmp(c, &CRYPT[THE][k][0])==0) || (strcmp(c, &CRYPT[THIS][k][0])==0) || (strcmp(s, &CRYPT[THAT][k][0])==0) ) { flag = 1; break; } } if(flag) { break; } } if(flag) { for(i = 0; i < strlen(s)-1; i++) { if( (s[i]!=' ') && (s[i]!='.') ) { if( (s[i]-k) >= 'a' ) { putchar(s[i]-k); } else { putchar(s[i]-k + A_NUM); } } else { putchar(s[i]); } } printf("\n"); } } return 0; }
main.c: In function 'main': main.c:36:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 36 | while(gets(s) != NULL) { | ^~~~ | fgets main.c:36:23: warning: comparison between pointer and integer 36 | while(gets(s) != NULL) { | ^~
s521942420
p00017
C
#include <stdio.h> #include <string.h> #define MAX 80 // ˆÃ†•¶‚ÌÅ‘å•¶Žš” #define THE 0 // ”»•ʂɎg‚¤’PŒê #define THIS 1 #define THAT 2 #define SORT 3 // ”»•Ê’PŒê‚ÌŽí—Þ #define C_MAX 4 // ”»•Ê’PŒê‚ÌÅ‘å•¶Žš” #define A_NUM 26 // Žg—p•¶Žš‚̐” int main(void) { char s[MAX+1]; char str[MAX+1]; char CRYPT[SORT][A_NUM][C_MAX+1]; int shift; char *c; int flag; int i; for(i = 0; i < A_NUM; i++) { CRYPT[THE][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][2] = ('e'-'a'+i)%A_NUM + 'a'; CRYPT[THE][i][3] = '\0'; CRYPT[THIS][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][2] = ('i'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][3] = ('s'-'a'+i)%A_NUM + 'a'; CRYPT[THIS][i][4] = '\0'; CRYPT[THAT][i][0] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][1] = ('h'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][2] = ('a'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][3] = ('t'-'a'+i)%A_NUM + 'a'; CRYPT[THAT][i][4] = '\0'; } while(gets(s) != NULL) { memcpy(str, s, (strlen(s)+1)*sizeof(char)); shift = 0; flag = 0; c = strtok(str, " ."); while(c != NULL) { for(shift = 0; shift < A_NUM; shift++) { if( (strcmp(c, &CRYPT[THE][shift][0])==0) || (strcmp(c, &CRYPT[THIS][shift][0])==0) || (strcmp(s, &CRYPT[THAT][shift][0])==0) ) { flag = 1; break; } } if(flag) { break; } c = strtok(NULL, " ."); } for(i = 0; i < strlen(s)-1; i++) { // US(ASCII CODE 0x1F) ƒ†ƒjƒbƒg‹æØ‚è‚Ì•ª‚¾‚¯ƒ}ƒCƒiƒX if( (s[i]==' ') || (s[i]=='.') ) { printf("%1c", s[i]); } else { printf("%1c", s[i]-shift+((s[i]-shift)<'a')*A_NUM); } } printf("\n"); } return 0; }
main.c: In function 'main': main.c:38:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 38 | while(gets(s) != NULL) { | ^~~~ | fgets main.c:38:23: warning: comparison between pointer and integer 38 | while(gets(s) != NULL) { | ^~
s106774464
p00017
C
// AOJ Volume 0 Problem 0017 #include <stdio.h> #include <string.h> #define DIFF(c1, c2) ((((c2)-(c1))>=0)?((c2)-(c1)+1):((c2)-(c1)+1+26)) void conv(char *str, char *str_diff) { int i; i = 0; do { switch (str[i]){ case ' ': case '.': str_diff[i] = -2; break; case '\0': str_diff[i] = 0; break; default: if (str_diff[i - 1] == -2){ str_diff[i] = -1; } else { str_diff[i] = DIFF(str[i - 1], str[i]); } break; } // printf("[%d<%c>]", str_diff[i], str[i]); } while (str[i++] != '\0'); } int search(char *str1, char *str2) { int i; for (i = 0; i <= strlen(str1) - strlen(str2); i++){ if (strncmp(str1 + i, str2, strlen(str2)) == 0){ return (i); } } return (-1); } int main(void) { char str[82]; char str_diff[82]; char diff_the[5]; char diff_this[6]; char diff_that[6]; int pos; int diff; char c; int i; diff_the[0] = -1; diff_the[1] = DIFF('t', 'h'); diff_the[2] = DIFF('h', 'e'); diff_the[3] = -2; diff_the[4] = 0; diff_this[0] = -1; diff_this[1] = DIFF('t', 'h'); diff_this[2] = DIFF('h', 'i'); diff_this[3] = DIFF('i', 's'); diff_this[4] = -2; diff_this[5] = 0; diff_that[0] = -1; diff_that[1] = DIFF('t', 'h'); diff_that[2] = DIFF('h', 'a'); diff_that[3] = DIFF('a', 't'); diff_that[4] = -2; diff_that[5] = 0; str[0] = ' '; gets(&str[1]); conv(str, str_diff); if ((pos = search(str_diff, diff_the)) == -1){ if ((pos = search(str_diff, diff_this)) == -1){ pos = search(str_diff, diff_that); } } diff = str[pos] - 't'; if (diff < 0){ diff += 26; } for (i = 1; i < strlen(str); i++){ if ('a' <= str[i] && str[i] <= 'z'){ c = str[i] - 'a' - diff; if (c < 0){ c += 26; } c += 'a'; printf("%c", c); } else { printf("%c", str[i]); } } printf("\n"); return (0); }
main.c: In function 'main': main.c:85:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 85 | gets(&str[1]); | ^~~~ | fgets
s451644862
p00017
C
// AOJ Volume 0 Problem 0017 #include <stdio.h> #include <string.h> #define DIFF(c1, c2) ((((c2)-(c1))>=0)?((c2)-(c1)+1):((c2)-(c1)+1+26)) void conv(char *str, char *str_diff) { int i; i = 0; do { switch (str[i]){ case ' ': case '.': str_diff[i] = -2; break; case '\0': str_diff[i] = 0; break; default: if (str_diff[i - 1] == -2){ str_diff[i] = -1; } else { str_diff[i] = DIFF(str[i - 1], str[i]); } break; } // printf("[%d<%c>]", str_diff[i], str[i]); } while (str[i++] != '\0'); } int search(char *str1, char *str2) { int i; for (i = 0; i <= strlen(str1) - strlen(str2); i++){ if (memcmp(str1 + i, str2, strlen(str2)) == 0){ return (i); } } return (-1); } int main(void) { char str[82]; char str_diff[82]; char diff_the[5]; char diff_this[6]; char diff_that[6]; int pos; int diff; char c; int i; diff_the[0] = -1; diff_the[1] = DIFF('t', 'h'); diff_the[2] = DIFF('h', 'e'); diff_the[3] = -2; diff_the[4] = 0; diff_this[0] = -1; diff_this[1] = DIFF('t', 'h'); diff_this[2] = DIFF('h', 'i'); diff_this[3] = DIFF('i', 's'); diff_this[4] = -2; diff_this[5] = 0; diff_that[0] = -1; diff_that[1] = DIFF('t', 'h'); diff_that[2] = DIFF('h', 'a'); diff_that[3] = DIFF('a', 't'); diff_that[4] = -2; diff_that[5] = 0; str[0] = ' '; gets(&str[1]); conv(str, str_diff); if ((pos = search(str_diff, diff_the)) == -1){ if ((pos = search(str_diff, diff_this)) == -1){ pos = search(str_diff, diff_that); } } diff = str[pos] - 't'; if (diff < 0){ diff += 26; } for (i = 1; i < strlen(str); i++){ if ('a' <= str[i] && str[i] <= 'z'){ c = str[i] - 'a' - diff; if (c < 0){ c += 26; } c += 'a'; printf("%c", c); } else { printf("%c", str[i]); } } printf("\n"); return (0); }
main.c: In function 'main': main.c:85:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 85 | gets(&str[1]); | ^~~~ | fgets
s581717695
p00017
C
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws InterruptedException, IOException { BufferedReader din = new BufferedReader(new InputStreamReader(System.in)); String data , str; char tmp; while ( true ){ data = din.readLine(); if ( data == null ) break; while ( true ) { String sarch = data; Scanner sc = new Scanner(sarch); if ( sc.findInLine("this") != null || sc.findInLine("the") != null || sc.findInLine("that") != null ) { break; } else { str = ""; for ( int j = 0; j < data.length(); j++ ) { if ( data.charAt(j) == '.' ) tmp = '.'; else if ( data.charAt(j) == ' ' ) tmp = ' '; else { tmp = (char)(data.charAt(j)+1); if ( tmp > 122 ) tmp -= 26; } str += tmp; } } data = str; } System.out.println(data); } } }
main.c:1:1: error: unknown type name 'import' 1 | import java.io.*; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.io.*; | ^ main.c:2:1: error: unknown type name 'import' 2 | import java.util.*; | ^~~~~~ main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 2 | import java.util.*; | ^ main.c:4:1: error: unknown type name 'public' 4 | public class Main { | ^~~~~~ main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main' 4 | public class Main { | ^~~~
s360880769
p00017
C
#include<stdio.h> #include<string.h> main(){ char s[10000]; char this[10]="this"; char that[10]="that"; //(scanf("%[^\n]s",s) while(gets(s)!=NULL){ int n,i; n=strlen(s); while(1){ int co=0; for(i=0;i<n;i++){ if(97<=s[i] && 122>=s[i]){ s[i]--; if(s[i]==96){ s[i]=122; } } } for(i=0;i<n;i++){ if(s[i]==this[0]){ if(s[i+1]==this[1]){ if(s[i+2]==this[2]){ if(s[i+3]==this[3]){ co=1; } } else if(s[i+2]==that[2]){ if(s[i+3]==that[3]){ co=1; } } } } } if(co==1){ break; } } printf("%s\n",s); } return 0; }
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int] 4 | main(){ | ^~~~ main.c: In function 'main': main.c:11:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 11 | while(gets(s)!=NULL){ | ^~~~ | fgets main.c:11:16: warning: comparison between pointer and integer 11 | while(gets(s)!=NULL){ | ^~
s057912680
p00017
C
#include<stdio.h> #include<string.h> main(){ char s[10000]; char this[10]="this"; char that[10]="that"; while(gets(s)!=NULL){ int n,i; n=strlen(s); while(1){ int co=0; for(i=0;i<n;i++){ if(97<=s[i] && 122>=s[i]){ s[i]--; if(s[i]==96){ s[i]=122; } } } for(i=0;i<n;i++){ if(s[i]==this[0]){ if(s[i+1]==this[1]){ if(s[i+2]==this[2]){ if(s[i+3]==this[3]){ co=1; } } else if(s[i+2]==that[2]){ if(s[i+3]==that[3]){ co=1; } } } } } if(co==1){ break; } } printf("%s\n",s); } return 0; }
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int] 4 | main(){ | ^~~~ main.c: In function 'main': main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 10 | while(gets(s)!=NULL){ | ^~~~ | fgets main.c:10:16: warning: comparison between pointer and integer 10 | while(gets(s)!=NULL){ | ^~
s367279869
p00017
C
#include <stdio.h> /*ƒV[ƒU[ˆÃ†*/ int main(){ char str[81]; int i; while(gets(str)!=NULL){ char zure=(str[0]-'t'); for(i=0;str[i]!='\0';i++) if(str[i]!=' ' && str[i]!='.') str[i] -= zure; printf(str); printf("\n"); } return 0; }
main.c: In function 'main': main.c:7:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 7 | while(gets(str)!=NULL){ | ^~~~ | fgets main.c:7:24: warning: comparison between pointer and integer 7 | while(gets(str)!=NULL){ | ^~
s350290494
p00017
C
#define s(p)!strstr(a,"th"#p)&& char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;}
main.c:2:8: error: return type defaults to 'int' [-Wimplicit-int] 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^~~~ main.c: In function 'main': main.c:2:8: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:2:8: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:2:23: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^~~~ main.c:2:32: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts' +++ |+#include <stdio.h> 1 | #define s(p)!strstr(a,"th"#p)&& main.c:2:37: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion] 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ | | | int main.c:2:37: note: expected 'const char *' but argument is of type 'int' main.c:1:14: error: implicit declaration of function 'strstr' [-Wimplicit-function-declaration] 1 | #define s(p)!strstr(a,"th"#p)&& | ^~~~~~ main.c:2:45: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:1: note: include '<string.h>' or provide a declaration of 'strstr' +++ |+#include <string.h> 1 | #define s(p)!strstr(a,"th"#p)&& main.c:1:14: warning: incompatible implicit declaration of built-in function 'strstr' [-Wbuiltin-declaration-mismatch] 1 | #define s(p)!strstr(a,"th"#p)&& | ^~~~~~ main.c:2:45: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:14: note: include '<string.h>' or provide a declaration of 'strstr' 1 | #define s(p)!strstr(a,"th"#p)&& | ^~~~~~ main.c:2:45: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:21: error: passing argument 1 of 'strstr' makes pointer from integer without a cast [-Wint-conversion] 1 | #define s(p)!strstr(a,"th"#p)&& | ^ | | | int main.c:2:45: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:21: note: expected 'const char *' but argument is of type 'int' 1 | #define s(p)!strstr(a,"th"#p)&& | ^ main.c:2:45: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:21: error: passing argument 1 of 'strstr' makes pointer from integer without a cast [-Wint-conversion] 1 | #define s(p)!strstr(a,"th"#p)&& | ^ | | | int main.c:2:50: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:21: note: expected 'const char *' but argument is of type 'int' 1 | #define s(p)!strstr(a,"th"#p)&& | ^ main.c:2:50: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:21: error: passing argument 1 of 'strstr' makes pointer from integer without a cast [-Wint-conversion] 1 | #define s(p)!strstr(a,"th"#p)&& | ^ | | | int main.c:2:55: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:1:21: note: expected 'const char *' but argument is of type 'int' 1 | #define s(p)!strstr(a,"th"#p)&& | ^ main.c:2:55: note: in expansion of macro 's' 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^ main.c:2:67: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 2 | char*c;main(i,a){for(;gets(a);!puts(a))for(;s(is)s(at)s(e)1;)for(c=a;*c;c++)*c=*c<97?*c:(*c+8)%26+97;} | ^
s278360872
p00017
C
main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 's' defaults to 'int' [-Wimplicit-int] main.c:1:22: error: initialization of 'char *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^ main.c:1:26: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} main.c:1:26: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^~~~~ main.c:1:26: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:45: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^~~~ main.c:1:45: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:50: error: passing argument 1 of 'puts' makes pointer from integer without a cast [-Wint-conversion] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^ | | | int main.c:1:50: note: expected 'const char *' but argument is of type 'int' main.c:1:63: error: implicit declaration of function 'strstr' [-Wimplicit-function-declaration] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'strstr' +++ |+#include <string.h> 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} main.c:1:63: warning: incompatible implicit declaration of built-in function 'strstr' [-Wbuiltin-declaration-mismatch] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^~~~~~ main.c:1:63: note: include '<string.h>' or provide a declaration of 'strstr' main.c:1:71: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 1 | main(i,s){for(char*t=&i;~scanf("%[^\n] ",s);puts(s))for(;*t||!strstr(t=s,"th");*t++-=*t-97?*t>>6:-25);} | ^
s364068345
p00017
C
#include <stdio.h> #include <string.h> int main(void){ char str[81]; int key; int len; int i; while(gets(str) != '\0'){ key = 't' - str[0]; len = strlen(str); for(i=0; i < len; i++){ if(str[i] == ' ' || str[i] == '.') continue; str[i] += key; if(str[i] < 'a') str[i] = 'z' + 1 - ('a' - str[i]); } printf("%s\n", str); } return 0; }
main.c: In function 'main': main.c:10:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 10 | while(gets(str) != '\0'){ | ^~~~ | fgets
s477099145
p00017
C
#include<string.h> #include<stdio.h> using namespace std; int main(){ char a[100],b[100]; for(int i;i<100;i++){ a[i]='\0'; b[i]='\0'; } gets(a); int i=0; while(i<26){ for(int j=0;!(a[j]=='\0');j++){ if(0x61<=a[j]+i&&a[j]+i<=0x7A) b[j]+=i; else if(0x61<=a[j]&&a[j]<=0x7A){ b[j]=a[j]-26+i; } else if(a[j]==' ') b[j]=' '; else if(a[j]=='.') b[j]='.'; } if(strstr(b,"the")||strstr(b,"this")||strstr(b,"that")) break; i++; } for(int k=0;a[k]!='\0';k++) printf("%s",b[k]); printf("\n"); return 0; }
main.c:3:1: error: unknown type name 'using' 3 | using namespace std; | ^~~~~ main.c:3:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 3 | using namespace std; | ^~~ main.c: In function 'main': main.c:11:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 11 | gets(a); | ^~~~ | fgets
s011195793
p00017
C
main(){gets();}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){gets();} | ^~~~ main.c: In function 'main': main.c:1:8: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 1 | main(){gets();} | ^~~~
s607245374
p00017
C
#include<stdio.h> #include<string.h> char a[100]; int flag=1; void shift(){ int i=0; while(a[i]!=0){ if(a[i]>='a' && a[i]<='y') a[i]++; else if(a[i]=='z') a[i]='a'; i++; } } void match(){ char b[4]; char m[3][5]={"this","the","that"}; int i; for(i=0;i<4;i++) b[i]=a[i]; for(i=0;i<3;i++){ if(strcmp(b,m[i])==0) flag=0; } } int main(){ gets(a); while(flag){ shift(); match(); } printf("%s\n",a); return 0; }
main.c: In function 'main': main.c:33:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 33 | gets(a); | ^~~~ | fgets
s899079598
p00017
C
#include<stdio.h> #include<string.h> char a[100]; int flag=1; void shift(){ int i=0; while(a[i]!=0){ if(a[i]>='a' && a[i]<='y') a[i]++; else if(a[i]=='z') a[i]='a'; i++; } } void match(){ char b[4]; char m[3][5]={"this","the","that"}; int i; for(i=0;i<4;i++) b[i]=a[i]; for(i=0;i<3;i++){ if(strcmp(b,m[i])==0) flag=0; } } int main(){ gets(a); while(flag){ shift(); match(); } printf("%s\n",a); return 0; }
main.c: In function 'main': main.c:33:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 33 | gets(a); | ^~~~ | fgets
s971294568
p00017
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char str[81]; while(gets(str) != NULL) { int i,j; int len = strlen(str); for(i = 0;i < 26;i++) { for(j = 0;j < len;j++) { if(str[j] >= 'a' && str[j] <= 'z') { str[j] = (str[j] - 'a' + 1) % 26 + 'a'; } } for(j = 0;j < len-2;j++) { if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'e') { puts(str); break; } } if(j != len-2) break; for(j = 0;j < len-3;j++) { if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'i' && str[j+3] == 's') { puts(str); break; } } if(j != len-3) break; for(j = 0;j < len-3;j++) { if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'a' && str[j+3] == 't') { puts(str); break; } } if(j != len-3) break; } } }
main.c: In function 'main': main.c:8:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | while(gets(str) != NULL) | ^~~~ | fgets main.c:8:25: warning: comparison between pointer and integer 8 | while(gets(str) != NULL) | ^~
s028427611
p00017
C
#include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char str[81]; while(gets(str) != NULL) { int i,j; int len = strlen(str); for(i = 0;i < 26;i++) { for(j = 0;j < len;j++) { if(str[j] >= 'a' && str[j] <= 'z') { str[j] = (str[j] - 'a' + 1) % 26 + 'a'; } } for(j = 0;j < len-2;j++) { if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'e') { puts(str); break; } } if(j != len-2) break; for(j = 0;j < len-3;j++) { if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'i' && str[j+3] == 's') { puts(str); break; } } if(j != len-3) break; for(j = 0;j < len-3;j++) { if(str[j] == 't' && str[j+1] == 'h' && str[j+2] == 'a' && str[j+3] == 't') { puts(str); break; } } if(j != len-3) break; } } return 0; }
main.c: In function 'main': main.c:8:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | while(gets(str) != NULL) | ^~~~ | fgets main.c:8:25: warning: comparison between pointer and integer 8 | while(gets(str) != NULL) | ^~
s445164306
p00017
C
#include<stdio.h> #include<string.h> #define s_plen(STR) STR,strlen(STR) #define test_the(p, len) test_xxx((p), (len),s_plen("the")) #define test_that(p, len) test_xxx((p), (len), s_plen("that")) #define test_this(p, len) test_xxx((p), (len), s_plen("this")) char rotate(char t, int i){ int r; if (t == '.') return t; if (t == ' ') return t; r = t+i; if (r > 'z'){ return (char)(r - 'z' + 'a' - 1); } return (char)r; } void decode_line(char * src, int shift){ while (*src){ printf("%c", rotate(*src, shift)); src++; } printf("\n"); } void println_plen(char* p, int l){ int i; for(i=0;i<l;i++){ printf("%c", *(p+i)); } printf("\n"); } int match_xxx_with(char* srcp, int srclen, char* tp, int tlen, int n){ int i; //printf("match_xxx_with\n"); //println_plen(srcp, srclen); //println_plen(tp, tlen); for(i=0; i<srclen; i++){ if (rotate(*srcp, n)!=*tp)return 0; } return 1; } int test_xxx(char* srcp, int srclen, char* tp, int tlen){ /* * found .. shift * fail .. < 0 */ int i; int guess; if (srclen != tlen) return -1; for (guess=0; guess < ('z' - 'a'); guess++){ if (match_xxx_with(srcp, srclen, tp, tlen, guess)){ return guess; } } return -1; } int chop_slen(char** srcp, int* srclen, char**tokp, int*toklen){ *tokp = *srcp; *toklen = 0; while (strlen){ //printf("%c\n", **(srcp)); switch (**srcp){ case ' ': return *toklen; case '.': return *toklen; default: break; } //consume (*toklen)++; (*srcp)++; (srclen)--; } return 0; } int main(){ char buf[80]; char *p; int len; char *tokp; int toklen; int key; while (gets(buf)){ key = -1; p = buf; len = strlen(buf); //printf("==>%s\n", p); while(chop_slen(&p, &len, &tokp, &toklen)){ //println_plen(tokp, toklen); //println_plen(p, len); if ((key = test_the(tokp, toklen)) > -1) break; if ((key = test_this(tokp, toklen)) > -1) break; if ((key = test_that(tokp, toklen)) > -1) break; } //printf("key =>%d\n", key); decode_line(buf, key); } return 0; }
main.c: In function 'main': main.c:102:10: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 102 | while (gets(buf)){ | ^~~~ | fgets
s129063159
p00017
C
#include<stdio.h> #include<string.h> #define s_plen(STR) STR,strlen(STR) #define test_the(p, len) test_xxx((p), (len),s_plen("the")) #define test_that(p, len) test_xxx((p), (len), s_plen("that")) #define test_this(p, len) test_xxx((p), (len), s_plen("this")) char rotate(char t, int i){ int r; if (t == '.') return t; if (t == ' ') return t; r = t+i; if (r > 'z'){ return (char)(r - 'z' + 'a' - 1); } return (char)r; } void decode_line(char * src, int shift){ while (*src){ printf("%c", rotate(*src, shift)); src++; } printf("\n"); } void println_plen(char* p, int l){ int i; for(i=0;i<l;i++){ printf("%c", *(p+i)); } printf("\n"); } int match_xxx_with(char* srcp, int srclen, char* tp, int tlen, int n){ int i; //printf("match_xxx_with\n"); //println_plen(srcp, srclen); //println_plen(tp, tlen); for(i=0; i<srclen; i++){ if (rotate(*srcp, n)!=*tp)return 0; } return 1; } int test_xxx(char* srcp, int srclen, char* tp, int tlen){ /* * found .. shift * fail .. < 0 */ int i; int guess; if (srclen != tlen) return -1; for (guess=0; guess < ('z' - 'a'); guess++){ if (match_xxx_with(srcp, srclen, tp, tlen, guess)){ return guess; } } return -1; } int chop_slen(char** srcp, int* srclen, char**tokp, int*toklen){ *tokp = *srcp; *toklen = 0; while (strlen){ //printf("%c\n", **(srcp)); switch (**srcp){ case ' ': return *toklen; case '.': return *toklen; default: break; } //consume (*toklen)++; (*srcp)++; (srclen)--; } return 0; } int main(){ char buf[80]; char *p; int len; char *tokp; int toklen; int key; while (gets(buf)){ key = -1; p = buf; len = strlen(buf); //printf("==>%s\n", p); while(chop_slen(&p, &len, &tokp, &toklen)){ //println_plen(tokp, toklen); //println_plen(p, len); if ((key = test_the(tokp, toklen)) > -1) break; if ((key = test_this(tokp, toklen)) > -1) break; if ((key = test_that(tokp, toklen)) > -1) break; } //printf("key =>%d\n", key); decode_line(buf, key); } return 0; }
main.c: In function 'main': main.c:103:10: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 103 | while (gets(buf)){ | ^~~~ | fgets
s901100549
p00017
C
#include<stdio.h> #include<string.h> #define s_plen(STR) STR,strlen(STR) #define test_the(p, len) test_xxx((p), (len),s_plen("the")) #define test_that(p, len) test_xxx((p), (len), s_plen("that")) #define test_this(p, len) test_xxx((p), (len), s_plen("this")) #define DEBUG 0 char rotate(char t, int i){ int r; if (t == '.') return t; if (t == ' ') return t; r = t+i; if (r > 'z'){ return (char)(r - 'z' + 'a' - 1); } return (char)r; } void decode_line(char * src, int shift){ while (*src){ printf("%c", rotate(*src, shift)); src++; } printf("\n"); } void println_plen(char* p, int l){ int i; for(i=0;i<l;i++){ printf("%c", *(p+i)); } printf("\n"); } int match_xxx_with(char* srcp, int srclen, char* tp, int tlen, int n){ int i; if(DEBUG){ printf("match_xxx_with\n"); println_plen(srcp, srclen); println_plen(tp, tlen); } for(i=0; i<srclen; i++){ if (rotate(*srcp, n)!=*tp)return 0; } return 1; } int test_xxx(char* srcp, int srclen, char* tp, int tlen){ /* * found .. shift * fail .. < 0 */ int i; int guess; if (srclen != tlen) return -1; for (guess=0; guess < ('z' - 'a'); guess++){ if (match_xxx_with(srcp, srclen, tp, tlen, guess)){ return guess; } } return -1; } int chop_slen(char** srcp, int* srclen, char**tokp, int*toklen){ *tokp = *srcp; *toklen = 0; while (strlen){ if(DEBUG){ printf("%c\n", **(srcp)); } switch (**srcp){ case ' ': return *toklen; case '.': return *toklen; default: break; } /* consume */ (*toklen)++; (*srcp)++; (srclen)--; } return 0; } int main(){ char buf[80]; char *p; int len; char *tokp; int toklen; int key; while (gets(buf)){ key = -1; p = buf; len = strlen(buf); if (DEBUG){ printf("==>%s\n", p); } while(chop_slen(&p, &len, &tokp, &toklen)){ if (DEBUG){ println_plen(tokp, toklen); println_plen(p, len); } if ((key = test_the(tokp, toklen)) > -1) break; if ((key = test_this(tokp, toklen)) > -1) break; if ((key = test_that(tokp, toklen)) > -1) break; } if (DEBUG){ printf("key =>%d\n", key); } decode_line(buf, key); } return 0; }
main.c: In function 'main': main.c:107:10: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 107 | while (gets(buf)){ | ^~~~ | fgets
s282556164
p00017
C
include<stdio.h> #include<string.h> #define BUFSIZE 81 #define s_plen(STR) STR,strlen(STR) #define test_the(p, len) test_xxx((p), (len),s_plen("the")) #define test_that(p, len) test_xxx((p), (len), s_plen("that")) #define test_this(p, len) test_xxx((p), (len), s_plen("this")) #define DEBUG 0 int readline(char*buf, int len){ char *s; s = fgets(buf, BUFSIZE, stdin); return strlen(s); } char rotate(char t, int i){ int r; if (t == '.') return t; if (t == ' ') return t; r = t+i; if (r > 'z'){ return (char)(r - 'z' + 'a' - 1); } return (char)r; } void decode_line(char * src, int shift){ while (*src){ printf("%c", rotate(*src, shift)); src++; } printf("\n"); } void println_plen(char* p, int l){ int i; for(i=0;i<l;i++){ printf("%c", *(p+i)); } printf("\n"); } int match_xxx_with(char* srcp, int srclen, char* tp, int tlen, int n){ int i; if(DEBUG){ printf("match_xxx_with\n"); println_plen(srcp, srclen); println_plen(tp, tlen); } for(i=0; i<srclen; i++){ if (rotate(*srcp, n)!=*tp)return 0; } return 1; } int test_xxx(char* srcp, int srclen, char* tp, int tlen){ /* * found .. shift * fail .. < 0 */ int i; int guess; if (srclen != tlen) return -1; for (guess=0; guess < ('z' - 'a'); guess++){ if (match_xxx_with(srcp, srclen, tp, tlen, guess)){ return guess; } } return -1; } int chop_slen(char** srcp, int* srclen, char**tokp, int*toklen){ *tokp = *srcp; *toklen = 0; while (strlen){ if(DEBUG){ printf("%c\n", **(srcp)); } switch (**srcp){ case ' ': return *toklen; case '.': return *toklen; default: break; } /* consume */ (*toklen)++; (*srcp)++; (srclen)--; } return 0; } int main(){ char buf[BUFSIZE]; char *p; int len; char *tokp; int toklen; int key; while (readline(buf, BUFSIZE)){ key = -1; p = buf; len = strlen(buf); if (DEBUG){ printf("==>%s\n", p); } while(chop_slen(&p, &len, &tokp, &toklen)){ if (DEBUG){ println_plen(tokp, toklen); println_plen(p, len); } if ((key = test_the(tokp, toklen)) > -1) break; if ((key = test_this(tokp, toklen)) > -1) break; if ((key = test_that(tokp, toklen)) > -1) break; } if (DEBUG){ printf("key =>%d\n", key); } decode_line(buf, key); } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:466:40: error: unknown type name
s110072166
p00017
C
#include<iostream> #include<string> using namespace std; string thi[100],tha[100],the[100]; string change_str(string ch,int mov); void set(void); int main() { int i,j; char ch[100]; set(); for(;cin.getline(ch,81);) { for(i=0;i<27;i++) { int se; se=string(ch).find(thi[i],0); if(se!=string::npos) break; se=string(ch).find(tha[i],0); if(se!=string::npos) break; se=string(ch).find(the[i],0); if(se!=string::npos) break; } string ans; ans=change_str(string(ch),26-i); cout << ans << endl; string(ch)=""; } } void set(void) { int i,j; thi[0]="this"; tha[0]="that"; the[0]="the"; for(i=1;i<27;i++) { int a,b,c; thi[0]=change_str(thi[0],1); tha[0]=change_str(tha[0],1); the[0]=change_str(the[0],1); thi[i]=thi[0]; tha[i]=tha[0]; the[i]=the[0]; } } string change_str(string change,int mov) { for(int i=0;i<mov;i++) { for(int j=0;j<change.size();j++) { int a; a=int(change[j]); if(a>95 && a<123) { change[j]++; if(a==122) change[j]-=26; } } } return change; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s811621992
p00017
C
#include<iostream> #include<string> using namespace std; string thi[100],tha[100],the[100]; string change_str(string ch,int mov); int set(void); int main() { int i,j; char ch[100]; set(); for(;cin.getline(ch,81);) { for(i=0;i<27;i++) { int se; se=string(ch).find(thi[i],0); if(se!=string::npos) break; se=string(ch).find(tha[i],0); if(se!=string::npos) break; se=string(ch).find(the[i],0); if(se!=string::npos) break; } string ans; ans=change_str(string(ch),26-i); cout << ans << endl; string(ch)=""; } } int set(void) { int i,j; thi[0]="this"; tha[0]="that"; the[0]="the"; for(i=1;i<27;i++) { int a,b,c; thi[0]=change_str(thi[0],1); tha[0]=change_str(tha[0],1); the[0]=change_str(the[0],1); thi[i]=thi[0]; tha[i]=tha[0]; the[i]=the[0]; } return 0; } string change_str(string change,int mov) { for(int i=0;i<mov;i++) { for(int j=0;j<change.size();j++) { int a; a=int(change[j]); if(a>95 && a<123) { change[j]++; if(a==122) change[j]-=26; } } } return change; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s172046624
p00017
C
#include <stdio.h> #include <string.h> int main() { int i, l, c=0; char str[80]; while(scanf("%[^\n]",&str)!=EOF) { // Get String length for(l=1;1;l++) { if (str[l]=='\0') break; } for(c=0;c<26;c++) { for(i=0;i<l;i++) { // if str[i] is "." or " ", I will do nothing. if ((str[i]==' ')||(str[i]=='.')) continue; if (str[i]<='a') str[i]='z'; else str[i]--; } if ((strstr(str ,"the")!=0)|| (strstr(str ,"this")!=0)|| (strstr(str ,"that")!=0)) break; } printf("%s\n",str); // Set NULL in string for(c=0;c<80;c++) { str[c]='\0'; } } return 0;
main.c: In function 'main': main.c:33:9: error: expected declaration or statement at end of input 33 | return 0; | ^~~~~~
s058787668
p00017
C
#include<stdio.h> #include<string.h> char p[1024]; char y[1024]; int main(void){ while(gets(p)){ int x = strlen(p); int f = 0; for(int i = 0; i < 26; i++){ for(int j = 0; j < x; j++)if(p[j] >= 'a' && p[j] <='z')p[j] = (p[j]+1-'a')%26 + 'a'; if(strstr(p,"the")!= NULL)break; if(strstr(p,"that")!= NULL)break; if(strstr(p,"this")!= NULL)break; } puts(p); } return 0; }
main.c: In function 'main': main.c:8:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 8 | while(gets(p)){ | ^~~~ | fgets
s590004767
p00017
C
using System; using System.Collections.Generic; class _0017 { public static void Main() { string str; List<string> sentence = new List<string>(); str = Console.ReadLine(); while ((str = Console.ReadLine()) != null)sentence.Add(str + '\n'); for (int i = 0; i < 26; i++) { str = Caesar(sentence, i); if (str.IndexOf("the") > -1 || str.IndexOf("this") > -1 || str.IndexOf("that") > -1) Console.WriteLine(str); } } public static string Caesar(List<string> def, int shift) { string result = ""; string mainSentence = ""; char c; for (int i = 0; i < def.Count; i++) mainSentence = mainSentence + def[i]; for (int i = 0; i < mainSentence.Length; i++) { c = mainSentence[i]; if (c != ' ' && c != ',' && c != '.' && c != '\n') { c += (char)shift; if ((int)c > (int)'z') c = (char)('`' + (c - 'z')); } result = result + c.ToString(); } return result; } }
main.c:1:1: error: unknown type name 'using' 1 | using System; | ^~~~~ main.c:2:1: error: unknown type name 'using' 2 | using System.Collections.Generic; | ^~~~~ main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 2 | using System.Collections.Generic; | ^ main.c:3:1: error: unknown type name 'class' 3 | class _0017 | ^~~~~ main.c:4:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 4 | { | ^
s041925973
p00017
C
include<stdio.h> #include<string.h> main(){ char str[85]; int l,i; while(fgets(str,81,stdin)!=NULL){ l=strlen(str); while(1){ if(strstr(str,"the ")!='\0'||strstr(str,"this ")!='\0'||strstr(str,"that ")!='\0'){ break; } else { for(i=0;i<l;i++){ if(str[i]>='a'&&str[i]<='y')str[i]+=1; else if(str[i]=='z') str[i]='a'; } } } printf("%s",str); } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^ In file included from main.c:2: /usr/include/string.h:44:22: error: unknown type name 'size_t' 44 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 33 | #include <stddef.h> +++ |+#include <stddef.h> 34 | /usr/include/string.h:47:56: error: unknown type name 'size_t' 47 | extern void *memmove (void *__dest, const void *__src, size_t __n) | ^~~~~~ /usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:55:32: error: unknown type name 'size_t' 55 | int __c, size_t __n) | ^~~~~~ /usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:61:42: error: unknown type name 'size_t' 61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:64:56: error: unknown type name 'size_t' 64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:80:60: error: unknown type name 'size_t' 80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:107:48: error: unknown type name 'size_t' 107 | extern void *memchr (const void *__s, int __c, size_t __n) | ^~~~~~ /usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:145:53: error: unknown type name 'size_t' 145 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:153:23: error: unknown type name 'size_t' 153 | size_t __n) __THROW __nonnull ((1, 2)); | ^~~~~~ /usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:159:57: error: unknown type name 'size_t' 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:166:8: error: unknown type name 'size_t' 166 | extern size_t strxfrm (char *__restrict __dest, | ^~~~~~ /usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:167:54: error: unknown type name 'size_t' 167 | const char *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:8: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:179:59: error: unknown type name 'size_t' 179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, | ^~~~~~ /usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:195:45: error: unknown type name 'size_t' 195 | extern char *strndup (const char *__string, size_t __n) | ^~~~~~ /usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:293:8: error: unknown type name 'size_t' 293 | extern size_t strcspn (const char *__s, const char *__reject) | ^~~~~~ /usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:297:8: error: unknown type name 'size_t' 297 | extern size_t strspn (const char *__s, const char *__accept) | ^~~~~~ /usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:389:46: error: unknown type name 'size_t' 389 | extern void *memmem (const void *__haystack, size_t __haystacklen, | ^~~~~~ /usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:390:44: error: unknown type name 'size_t' 390 | const void *__needle, size_t __needlelen) | ^~~~~~ /usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:398:55: error: unknown type name 'size_t' 398 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:401:53: error: unknown type name 'size_t' 401 | const void *__restrict __src, size_t __n) | ^~~~~~ /usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:407:8: error: unknown type name 'size_t' 407 | extern size_t strlen (const char *__s) | ^~~~~~ /usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:8: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:413:46: error: unknown type name 'size_t' 413 | extern size_t strnlen (const char *__string, size_t __maxlen) | ^~~~~~ /usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33, from /usr/include/string.h:26: /usr/include/string.h:432:12: error: unknown type name 'size_t' 432 | extern int __REDIRECT_NTH (strerror_r, | ^~~~~~~~~~~~~~ /usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' In file included from /usr/include/string.h:462: /usr/include/strings.h:34:54: error: unknown type name 'size_t' 34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' 23 | #include <stddef.h> +++ |+#include <stddef.h> 24 | /usr/include/strings.h:38:53: error: unknown type name 'size_t' 38 | extern void bcopy (const void *__src, void *__dest, size_t __n) | ^~~~~~ /usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:42:31: error: unknown type name 'size_t' 42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1)); | ^~~~~~ /usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:120:61: error: unknown type name 'size_t' 120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) | ^~~~~~ /usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/strings.h:134:27: error: unknown type name 'size_t' 134 | size_t __n, locale_t __loc) | ^~~~~~ /usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>' /usr/include/string.h:466:40: error: unknown type name
s171472023
p00017
C
#include <stdio.h> int main(void){ char words[128]; int i,j,zure,end; //while(scanf("%[^\n]",words) != EOF){// 文字列を配列に読み込む (scanf("%[^\n]",words); getchar(); zure=0,end=0; for(j=0;words[j] != '\0';j++){ for(i=1;i <= 26;i++){// 1つずつずらしていく if(words[j]+i > 'z'){// zを超えるとき if(words[j]+i-25 == 't' && words[j+1]+i-25 == 'h'){//1文字目t、2文字目h if(words[j+2]+i-25 == 'e'){// the zure = i-25; end = 1; break; //} }else if(words[j+2]+i-25 == 'a' && words[j+3]+i-25 == 't'){// that //if(words[j+4] == ' '){ zure = i-25; end = 1; break; }else if(words[j+2]+i-25 == 'i' && words[j+3]+i-25 == 's'){// this zure = i-25; end = 1; break; } } }else{//zを超えないとき if(words[j]+i == 't' && words[j+1]+i == 'h'){//1文字目t、2文字目h if(words[j+2]+i == 'e'){// the zure = i; end = 1; break; }else if(words[j+2]+i == 'a' && words[j+3]+i == 't'){// that zure = i; end = 1; break; }else if(words[j+2]+i == 'i' && words[j+3]+i == 's'){// this zure = i; end = 1; break; } } } } if(end == 1) break; } for(i=0;words[i] != '\0';i++){ if(zure < 0){// ズレがマイナスの場合 if(words[i] >= 'a' && words[i] <= 'z'){ if(words[i]+zure < 'a'){ printf("%c",words[i]+zure+26); }else{ printf("%c",words[i]+zure); } }else{ printf("%c",words[i]); } }else{ if(words[i] >= 'a' && words[i] <= 'z'){ if(words[i]+zure > 'z'){ printf("%c",words[i]+zure-26); }else{ printf("%c",words[i]+zure); } }else{ printf("%c",words[i]); } } } printf("\n"); //} return 0; }
main.c: In function 'main': main.c:8:31: error: expected ')' before ';' token 8 | (scanf("%[^\n]",words); | ~ ^ | ) main.c:77:18: error: expected ';' before '}' token 77 | return 0; | ^ | ; 78 | } | ~
s848382711
p00017
C
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES #include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #include<stdarg.h> #include<malloc.h> void caesar(char *); int main() { char *pstr, str[128]; pstr = str; while(gets(pstr) != NULL){ while(1){ caesar(pstr); if((strstr(pstr, "the") != NULL) || (strstr(pstr, "this") != NULL) || (strstr(pstr, "that") != NULL)) break; } printf("%s\n", pstr); } return 0; }
main.c: In function 'main': main.c:19:15: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 19 | while(gets(pstr) != NULL){ | ^~~~ | fgets main.c:19:26: warning: comparison between pointer and integer 19 | while(gets(pstr) != NULL){ | ^~
s256077339
p00017
C
#include <math.h> #define PI 3.14159265358979323 //int calc1(float a,float b,float c,float d,float e,float f,float *x,float *y); //void quick(int *,long long,long long); //int comp(char *a,char *b); int main(){ char a[100]; char b[100]; char c; int i,j,k,n; n=100; i=0; j=0; while(scanf("%c",&c)!=EOF){ if(c=='\n'){ j--; if(j==2&&( (b[0]-'t')-(b[1]-'h')+52 )%26==0&&( (b[0]-'t')-(b[2]-'e')+52 )%26==0) n=b[0]-'t'; if(j==3&&( (b[0]-'t')-(b[1]-'h')+52 )%26==0&&( (b[0]-'t')-(b[2]-'i')+52 )%26==0&&( (b[0]-'t')-(b[3]-'s')+52 )%26==0) n=b[0]-'t'; if(j==3&&( (b[0]-'t')-(b[1]-'h')+52 )%26==0&&( (b[0]-'t')-(b[2]-'a')+52 )%26==0&&( (b[0]-'t')-(b[3]-'t')+52 )%26==0) n=b[0]-'t'; n+=52; n=n%26; if(n==100) printf("error"); for(j=0;j<i;j++){ if(a[j]>='a'&&a[j]<='z'){ a[j]-=n; if(a[j]<'a') a[j]+=26; else if(a[j]>'z') a[j]-=26; } printf("%c",a[j]); } printf("\n"); n=100; i=0; j=0; }else{ a[i]=c; i++; if(c>='a'&&c<='z'){ b[j]=c; j++; if(j>10) j=0; }else{ j--; if(j==2&&( (b[0]-'t')-(b[1]-'h')+52 )%26==0&&( (b[0]-'t')-(b[2]-'e')+52 )%26==0) n=b[0]-'t'; if(j==3&&( (b[0]-'t')-(b[1]-'h')+52 )%26==0&&( (b[0]-'t')-(b[2]-'i')+52 )%26==0&&( (b[0]-'t')-(b[3]-'s')+52 )%26==0) n=b[0]-'t'; if(j==3&&( (b[0]-'t')-(b[1]-'h')+52 )%26==0&&( (b[0]-'t')-(b[2]-'a')+52 )%26==0&&( (b[0]-'t')-(b[3]-'t')+52 )%26==0) n=b[0]-'t'; j=0; } } } //for(i=0;i<=1000000000;i++); return 0; }
main.c: In function 'main': main.c:18:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 18 | while(scanf("%c",&c)!=EOF){ | ^~~~~ main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 1 | #include <math.h> +++ |+#include <stdio.h> 2 | #define PI 3.14159265358979323 main.c:18:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 18 | while(scanf("%c",&c)!=EOF){ | ^~~~~ main.c:18:15: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:18:31: error: 'EOF' undeclared (first use in this function) 18 | while(scanf("%c",&c)!=EOF){ | ^~~ main.c:18:31: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:18:31: note: each undeclared identifier is reported only once for each function it appears in main.c:31:33: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 31 | printf("error"); | ^~~~~~ main.c:31:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:31:33: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:31:33: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:40:41: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 40 | printf("%c",a[j]); | ^~~~~~ main.c:40:41: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:42:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 42 | printf("\n"); | ^~~~~~ main.c:42:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s609309854
p00017
C
int main(){ char c,str[81]; int i,code; while(fgets(str,81,stdin)!=EOF){ i=0; while(str[i]!='\0'){ if(str[i]==' ')i++; code=str[i]-'t'; i++; if(str[i]-code=='h'){ i++; if(str[i]-code=='e')break; if(str[i]-code=='i'&&str[i+1]-code=='s')break; if(str[i]-code=='a'&&str[i+1]-code=='t')break; } while(str[i]!=' ')i++; } for(i=0;str[i]!='\0';i++){ if(str[i]!=' '&&str[i]!='\n'&&str[i]!=','&&str[i]!='.'){ str[i]-=code; if(str[i]>'z')str[i]=str[i]-'z'+'a'; else if(str[i]<'a')str[i]=str[i]+'z'-'a'; } } printf("%s",str); } return 0; }
main.c: In function 'main': main.c:4:9: error: implicit declaration of function 'fgets' [-Wimplicit-function-declaration] 4 | while(fgets(str,81,stdin)!=EOF){ | ^~~~~ main.c:4:22: error: 'stdin' undeclared (first use in this function) 4 | while(fgets(str,81,stdin)!=EOF){ | ^~~~~ main.c:1:1: note: 'stdin' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' +++ |+#include <stdio.h> 1 | int main(){ main.c:4:22: note: each undeclared identifier is reported only once for each function it appears in 4 | while(fgets(str,81,stdin)!=EOF){ | ^~~~~ main.c:4:30: error: 'EOF' undeclared (first use in this function) 4 | while(fgets(str,81,stdin)!=EOF){ | ^~~ main.c:4:30: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:25:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 25 | printf("%s",str); | ^~~~~~ main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:25:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:25:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s500550390
p00017
C
void main(){ FILE *f1; char c; int c1,c2; printf("Data Input\n\n"); /*f1=fopen("input.txt","w"); while((c=getchar())!='\n') { putc(c,f1); } fclose(f1);*/ f1=fopen("input.txt","r"); while((c=getc(f1))!=EOF) { //printf("%c",c); if(c==' '||c=='.'){ printf("%c",c);continue; } c1=toascii(c); //printf("%d\t",c); c2=c1-4; printf("%c",c2); } fclose(f1); getch(); }
main.c: In function 'main': main.c:4:6: error: unknown type name 'FILE' 4 | FILE *f1; | ^~~~ main.c:1:1: note: 'FILE' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' +++ |+#include <stdio.h> 1 | main.c:7:6: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 7 | printf("Data Input\n\n"); | ^~~~~~ main.c:7:6: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:7:6: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:7:6: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:15:9: error: implicit declaration of function 'fopen' [-Wimplicit-function-declaration] 15 | f1=fopen("input.txt","r"); | ^~~~~ main.c:15:9: note: 'fopen' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:15:8: error: assignment to 'int *' from 'int' makes pointer from integer without a cast [-Wint-conversion] 15 | f1=fopen("input.txt","r"); | ^ main.c:16:15: error: implicit declaration of function 'getc' [-Wimplicit-function-declaration] 16 | while((c=getc(f1))!=EOF) | ^~~~ main.c:16:26: error: 'EOF' undeclared (first use in this function) 16 | while((c=getc(f1))!=EOF) | ^~~ main.c:16:26: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:16:26: note: each undeclared identifier is reported only once for each function it appears in main.c:22:10: error: implicit declaration of function 'toascii' [-Wimplicit-function-declaration] 22 | c1=toascii(c); | ^~~~~~~ main.c:27:6: error: implicit declaration of function 'fclose' [-Wimplicit-function-declaration] 27 | fclose(f1); | ^~~~~~ main.c:28:6: error: implicit declaration of function 'getch' [-Wimplicit-function-declaration] 28 | getch(); | ^~~~~
s077354309
p00017
C
#include <stdio.h> #include <string.h> int main() { char str[255]; int i; int l; i while(fgets(str,sizeof(str),stdin) != NULL) { l = strlen(str); while(1){ if(strstr(str,"the") != '\0' || strstr(str,"this") != '\0' || strstr(str, "that") != '\0') break; else { for(i = 0; i < l; i++) { if(str[i] >= 'a' && str[i] <= 'y') str[i]++; else if(str[i] == 'z') str[i] = 'a'; } } } printf("%s", str); } return 0; }
main.c: In function 'main': main.c:8:2: error: expected ';' before 'while' 8 | i | ^ | ; 9 | while(fgets(str,sizeof(str),stdin) != NULL) | ~~~~~
s874669191
p00017
C
#include<stdio.h> #include<string.h> int search(char []); int main(void){ int i,j,flag; char string[90]; while(1){ for(i = 0 ;; i ++){ string[i] = getchar(); if(string[i] == 'EOF'){ return 0; } if(string[i] == '.'){ string[i + 1] = '\0'; break; } } for(i = 0 ; i < 25; i ++){ for(j = 0 ;string[j] != '.' ; j ++){ if(string[j] != ' ' && string[j] != '\n'){ if(string[j] == 'z'){ string[j] -= 26; } string[j] += 1; } } flag = search(string); if(flag == 1){ printf("%s\n",string); break; } } return 0; } int search(char string[90]){ if(strstr(string,"the") != NULL || strstr(string,"this") != NULL || strstr(string,"that") != NULL){ return 1; } return 0; }
main.c: In function 'main': main.c:12:49: warning: multi-character character constant [-Wmultichar] 12 | if(string[i] == 'EOF'){ | ^~~~~ main.c:46:1: error: expected declaration or statement at end of input 46 | } | ^
s593910091
p00017
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <string> using namespace std; int main(){ char input[81],str[50][81]; int pos=0,last_pos=0,i,j,diff; const char cmp[3][5]={"that","this","the"}; bool is_found=false; scanf("%[^\n]",input); for(i=0;input[i]!='\0';i++){ if(input[i]==' ' || input[i]=='.'){ for(j=last_pos;j<i;j++){ str[pos][j]=input[j]; } str[pos][j]='\0'; pos++; last_pos=i+1; } } for(i=0;i<pos;i++){ for(j=0;j<4;j++){ diff=str[i][0]-cmp[j][0]; for(int k=1;str[i][k]!='\0';k++){ str[i][k]-=diff; } if(strcmp(str[i],cmp[j])){ j=4;i=pos; is_found=true; } } } for(i=0;input[i]!='\0';i++){ if(input[i]!='.' && input[i]!=' '){ input[i]-=diff; } } printf("%s\n",input); return 0; }
a.cc: In function 'int main()': a.cc:32:28: error: 'strcmp' was not declared in this scope 32 | if(strcmp(str[i],cmp[j])){ | ^~~~~~ a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <cstdlib> +++ |+#include <cstring> 4 | #include <string>
s200248274
p00017
C++
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
a.cc:1:1: error: 'xlmw' does not name a type 1 | xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt. | ^~~~
s299083121
p00017
C++
#include <cctype> #include <cstdio> #include <cstring> using namespace std; bool includes_keyword(const char *str) { const static char *keywords[] = { "the", "this", "that" }; for (const auto keyword : keywords) { char *pos = strstr(str, keyword); if (pos == NULL) { continue; } if (pos != str && isalpha(pos[-1])) { continue; } if (isalpha(pos[strlen(keyword)])) { continue; } return true; } return false; } int main() { while (!feof(stdin)) { char cipher[81]; fgets(cipher, 81, stdin); size_t len = strlen(cipher); if (cipher[len - 1] == '\n') { cipher[len - 1] = '\0'; } char c = 'z'; for (int i = 0; i < len; ++i) { if (isalpha(cipher[i]) && c > cipher[i]) { c = cipher[i]; } } int shift_begin = 'a' - c; int shift_end = shift_begin + 26; char decoded[81]; for (int shift = shift_begin; shift < shift_end; ++shift) { strcpy(decoded, cipher); for (int i = 0; i < len; ++i) { if (isalpha(decoded[i])) { decoded[i] += shift; } } if (includes_keyword(decoded)) { break; } } puts(decoded); } return 0; }
a.cc: In function 'bool includes_keyword(const char*)': a.cc:10:23: error: invalid conversion from 'const char*' to 'char*' [-fpermissive] 10 | char *pos = strstr(str, keyword); | ~~~~~~^~~~~~~~~~~~~~ | | | const char*
s369940536
p00017
C++
#include <bits/stdc++.h> using namespace std; int main() { string str; while (getline(cin, str)) { for (int i = 0; i < 26; ++i) { for (int j = 0; j < (int)str.size(); ++j) { if (str[j] >= 'a' && str[j] <= 'z') { str[j] = (str[j] - 'a' + 1) % 26 + 'a'; } } if (str.find("the") != string::npos || str.find("this") != string::npos || str.find("that") != string::npos) break; } cout << str << endl; str = solv(str); cout << str << endl; } }
a.cc: In function 'int main()': a.cc:17:23: error: 'solv' was not declared in this scope 17 | str = solv(str); | ^~~~
s716808832
p00017
C++
module main; import std.stdio; import std.string; void main() { string s; while((s = chomp(readln())).length) { char s2[] = new char[s.length]; for(auto i = 0; i < 26; i++) { for(auto j = 0; j < s.length; j++) { s2[j] = s[j]; if(!(s[j] == ' ' || s[j] == '\n' || s[j] == '.')) s2[j] = 'a' + ((s[j] - 'a') + i) % 26; } if(s2.indexOf("the") != -1 || s2.indexOf("this") != -1 || s2.indexOf("that") != -1) { writef("%s\n", s2); break; } } } }
a.cc:1:1: error: 'module' does not name a type 1 | module main; | ^~~~~~ a.cc:1:1: note: C++20 'module' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import std.stdio; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import std.string; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: '::main' must return 'int' 5 | void main() | ^~~~ a.cc: In function 'int main()': a.cc:7:3: error: 'string' was not declared in this scope 7 | string s; | ^~~~~~ a.cc:8:10: error: 's' was not declared in this scope 8 | while((s = chomp(readln())).length) | ^ a.cc:8:20: error: 'readln' was not declared in this scope 8 | while((s = chomp(readln())).length) | ^~~~~~ a.cc:8:14: error: 'chomp' was not declared in this scope 8 | while((s = chomp(readln())).length) | ^~~~~ a.cc:10:17: error: initializer fails to determine size of 's2' 10 | char s2[] = new char[s.length]; | ^~~~~~~~~~~~~~~~~~ a.cc:10:17: error: array must be initialized with a brace-enclosed initializer a.cc:20:13: error: request for member 'indexOf' in 's2', which is of non-class type 'char [1]' 20 | if(s2.indexOf("the") != -1 || s2.indexOf("this") != -1 || s2.indexOf("that") != -1) | ^~~~~~~ a.cc:20:40: error: request for member 'indexOf' in 's2', which is of non-class type 'char [1]' 20 | if(s2.indexOf("the") != -1 || s2.indexOf("this") != -1 || s2.indexOf("that") != -1) | ^~~~~~~ a.cc:20:68: error: request for member 'indexOf' in 's2', which is of non-class type 'char [1]' 20 | if(s2.indexOf("the") != -1 || s2.indexOf("this") != -1 || s2.indexOf("that") != -1) | ^~~~~~~ a.cc:22:9: error: 'writef' was not declared in this scope 22 | writef("%s\n", s2); | ^~~~~~
s963578061
p00017
C++
require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){for(s=26;s--;)r=i.replace(/[a-z]/g,function(j){return j.fromCharCode((j.charCodeAt(0)-97+s)%26+97)}),r.match(/th(e|is|at)/)?console.log(r):0})
a.cc:1:8: error: expected constructor, destructor, or type conversion before '(' token 1 | require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){for(s=26;s--;)r=i.replace(/[a-z]/g,function(j){return j.fromCharCode((j.charCodeAt(0)-97+s)%26+97)}),r.match(/th(e|is|at)/)?console.log(r):0}) | ^ a.cc:1:218: error: expected unqualified-id before ')' token 1 | require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){for(s=26;s--;)r=i.replace(/[a-z]/g,function(j){return j.fromCharCode((j.charCodeAt(0)-97+s)%26+97)}),r.match(/th(e|is|at)/)?console.log(r):0}) | ^
s645857596
p00017
C++
require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){for(s=26;s--;)r=i.replace(/[a-z]/g,function(j){return String.fromCharCode((j.charCodeAt(0)-97+s)%26+97)}),r.match(/th(e|is|at)/)?console.log(r):0})
a.cc:1:8: error: expected constructor, destructor, or type conversion before '(' token 1 | require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){for(s=26;s--;)r=i.replace(/[a-z]/g,function(j){return String.fromCharCode((j.charCodeAt(0)-97+s)%26+97)}),r.match(/th(e|is|at)/)?console.log(r):0}) | ^ a.cc:1:223: error: expected unqualified-id before ')' token 1 | require("fs").readFileSync("/dev/stdin","utf8").split('\n').map(function(i){for(s=26;s--;)r=i.replace(/[a-z]/g,function(j){return String.fromCharCode((j.charCodeAt(0)-97+s)%26+97)}),r.match(/th(e|is|at)/)?console.log(r):0}) | ^
s430707464
p00017
C++
string s
a.cc:1:2: error: 'string' does not name a type 1 | string s | ^~~~~~
s379225890
p00017
C++
import java.io.*; import java.util.regex.Pattern; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); Pattern pattern=Pattern.compile("the|this|that"); String str; try{ while((str=br.readLine())!=null){ char[] ch=str.toCharArray(); for(int j=0;!pattern.matcher(str).find()&j<26;j++){ for(int i=0;i<ch.length;i++){ if('a'<=ch[i]&&ch[i]<'z'){ //a???z??§???????????????????????? ch[i]++; }else if(ch[i]=='z'){ ch[i]='a'; //z????¬????a } } if(pattern.matcher(String.valueOf(ch)).find()){ break; } } System.out.println(ch); } }catch(Exception e){ } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.regex.Pattern; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s278588176
p00017
C++
#include<iostream> using namespace std; int main() { char key[80] = ""; cin.getline(key, sizeof(key); for (int i = 0; i < sizeof(key); i++) { //if (key[i] == (int)" ")cout << "space"; if ((int)key[i] == 0)break; if ((int)key[i] <= 122 && (int)key[i] >= 97) key[i] = (int)key[i] - 1; if (key[i] == 96)key[i] = 122; } for (int i = 0; i < sizeof(key); i++) { if ((int)key[i] == 0)break; cout << key[i]; } return 0; }
a.cc: In function 'int main()': a.cc:7:37: error: expected ')' before ';' token 7 | cin.getline(key, sizeof(key); | ~ ^ | )
s071960687
p00017
C++
#include<iostream> #include<string.h> #include<stdio.h> int main(){ char s[100]; while (gets(s)){ int diff; int flag = false; //一番最初に{the,that,this}がある場合 diff = s[0] - 't'; if ((s[1] - diff) == 'h'){ //printf("%c\n", s[j+1] - diff); if ((s[2] - diff) == 'e'){ //printf("%c\n", s[j + 2] - diff); if (s[3] == ' '){ flag = true; } } else if ((s[2] - diff) == 'a'){ //printf("%c\n", s[j + 2] - diff); if ((s[3] - diff) == 't'){ //printf("%c\n", s[j + 3] - diff); if (s[4] == ' '){ flag = true; } } } else if ((s[2] - diff) == 'i'){ //printf("%c\n", s[j + 2] - diff); if ((s[3] - diff) == 's'){ //printf("%c\n", s[j + 3] - diff); if (s[4] == ' '){ flag = true; } } } } if (!flag){ //一番以降に{the,that,this}がある場合 for (int j = 1; j < strlen(s); j++){ if ((s[j]) == ' '){ diff = s[j + 1] - 't'; if ((s[j + 1] - diff) == 't'){ //printf("diff:%d\n", diff); if ((s[j + 2] - diff) == 'h'){ //printf("%c\n", s[j+1] - diff); if ((s[j + 3] - diff) == 'e'){ //printf("%c\n", s[j + 2] - diff); if (s[j + 4] == ' '){ break; } } else if ((s[j + 3] - diff) == 'a'){ //printf("%c\n", s[j + 2] - diff); if ((s[j + 4] - diff) == 't'){ //printf("%c\n", s[j + 3] - diff); if (s[j + 5] == ' '){ break; } } } else if ((s[j + 3] - diff) == 'i'){ //printf("%c\n", s[j + 2] - diff); if ((s[j + 4] - diff) == 's'){ //printf("%c\n", s[j + 3] - diff); if (s[j + 5] == ' '){ break; } } } } } } } } //printf("diff:%d\n",diff); for (int i = 0; i < strlen(s); i++){ if (s[i] == ' ' || s[i] == '.')continue; s[i] -= diff; } //s[strlen(s) - 1] = '\n'; printf("%s\n", s); } return 0;
a.cc: In function 'int main()': a.cc:8:16: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | while (gets(s)){ | ^~~~ | getw a.cc:89:18: error: expected '}' at end of input 89 | return 0; | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s370908893
p00017
C++
#include<iostream> using namespace std; int main(){ char a; while(cin>>a){ if(a==' '||a=='.'||a=='\n')cout<<a; else for(int i=0;i<26;i++){ if((char)(a+i)=="that"||(char)(a+i)=="this"||(char)(a+i)=="the") { cout<<(char)(a+i); break; } i++; } cout<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if((char)(a+i)=="that"||(char)(a+i)=="this"||(char)(a+i)=="the") { | ~~~~~~~~~~~^~~~~~~~ a.cc:9:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if((char)(a+i)=="that"||(char)(a+i)=="this"||(char)(a+i)=="the") { | ~~~~~~~~~~~^~~~~~~~ a.cc:9:66: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 9 | if((char)(a+i)=="that"||(char)(a+i)=="this"||(char)(a+i)=="the") { | ~~~~~~~~~~~^~~~~~~
s866884733
p00017
C++
#include <bits/stdc++.h> using namespace std; void f(string &s) { for (char &c : s) { if ('a' <= c && c <= 'z') c = (c - 'a' + 25) % 26 + 'a'; } } int main() { string s; while (getline(cin, s)) { if (!s) break; while (s.find("the") == string::npos || s.find("this") == string::npos || s.find("that") == string::npos) f(s); cout << s << endl; } }
a.cc: In function 'int main()': a.cc:17:13: error: no match for 'operator!' (operand type is 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 17 | if (!s) break; | ^~ a.cc:17:13: note: candidate: 'operator!(bool)' (built-in) a.cc:17:13: note: no known conversion for argument 1 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
s950858186
p00017
C++
#define scanf_s scanf #define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 81 #define _MAX 100 #define ABC 26 int main(void) { int n, s = 0, x, y, r = 0, a, b; int sum_n[50][3] = { 0 }; char sum[50][_MAX], str[_MAX], bstr[_MAX], num[11] = { "0123456789" }; // while(gets_s(str) != EOF){ for (int i = 0; str[i] != '\0'; ++i) { if (str[i] - 't' == str[i + 1] - 'h') { a = str[i] - 't'; if ((str[i + 2] - a + 'z') % 'z' == 'e') { b = a; break; } else if ((str[i + 2] - a + 'z') % 'z' == 'i' + ABC && (str[i + 3] - a + 'z') % 'z' == 's') { b = a; break; } else if ((str[i + 2] - a + 'z') % 'z' == 'a' + ABC && (str[i + 3] - a + 'z') % 'z' == 't') { b = a; break; } } } for (int i = 0; str[i] != '\0'; ++i) { if ('a' <= str[i] && str[i] <= 'z') { printf("%c", (str[i] - a + 'z') % 'z'); } else { printf("%c", str[i]); } } printf("\n"); } }
a.cc: In function 'int main()': a.cc:2:16: error: 'gets' was not declared in this scope; did you mean 'getw'? 2 | #define gets_s gets | ^~~~ a.cc:17:15: note: in expansion of macro 'gets_s' 17 | while(gets_s(str) != EOF){ | ^~~~~~
s297172002
p00017
C++
#define scanf_s scanf #define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 81 #define _MAX 100 #define ABC 26 int main(void) { int n, s = 0, x, y, r = 0, d; char str[MAX]; while (gets_s(str, _MAX) != NULL) { for (int i = 0; str[i] != '\0'; ++i) { if (str[i] - 't' == str[i + 1] - 'h') { d = str[i] - 't'; if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; } else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'i' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 's' - 'a') { break; } else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'a' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 't' - 'a') { break; } } } for (int i = 0; str[i] != '\0'; ++i) { if ('a' <= str[i] && str[i] <= 'z') { printf("%c", (str[i] - 'a' - d + ABC) % ABC + 'a'); } else { printf("%c", str[i]); } } // printf("\n"); } }
a.cc: In function 'int main()': a.cc:2:16: error: 'gets' was not declared in this scope; did you mean 'getw'? 2 | #define gets_s gets | ^~~~ a.cc:15:16: note: in expansion of macro 'gets_s' 15 | while (gets_s(str, _MAX) != NULL) { | ^~~~~~
s258522558
p00017
C++
#define scanf_s scanf #define gets_s gets #include <stdio.h> #include <string> #include <iostream> #include <math.h> using namespace std; #define MAX 81 #define _MAX 100 #define ABC 26 int main(void) { int n, s = 0, x, y, r = 0, d; char str[MAX]; while (gets_s(str) != NULL) { for (int i = 0; str[i] != '\0'; ++i) { if (str[i] - 't' == str[i + 1] - 'h') { d = str[i] - 't'; if ((str[i + 2] - 'a' - d + ABC) % ABC == 'e' - 'a') { break; } else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'i' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 's' - 'a') { break; } else if ((str[i + 2] - 'a' - d + ABC) % ABC == 'a' - 'a' && (str[i + 3] - 'a' - d + ABC) % ABC == 't' - 'a') { break; } } } for (int i = 0; str[i] != '\0'; ++i) { if ('a' <= str[i] && str[i] <= 'z') { str[i] = (str[i] - 'a' - d + ABC) % ABC + 'a'; } } printf("%s\n", str[i]); } }
a.cc: In function 'int main()': a.cc:2:16: error: 'gets' was not declared in this scope; did you mean 'getw'? 2 | #define gets_s gets | ^~~~ a.cc:15:16: note: in expansion of macro 'gets_s' 15 | while (gets_s(str) != NULL) { | ^~~~~~ a.cc:29:36: error: 'i' was not declared in this scope 29 | printf("%s\n", str[i]); | ^
s973789638
p00017
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ stirng s; while(getiline(cin,s)){ while(s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos){ for(int i = 0; i < s.size(): i++){ if(s[i] == 'z') s[i] = 'a'; else if(s[i] >= 'a' && s[i] <= 'z') s[i]++; } } cout << s << endl; } }
a.cc: In function 'int main()': a.cc:7:9: error: 'stirng' was not declared in this scope 7 | stirng s; | ^~~~~~ a.cc:8:28: error: 's' was not declared in this scope 8 | while(getiline(cin,s)){ | ^ a.cc:8:15: error: 'getiline' was not declared in this scope; did you mean 'getline'? 8 | while(getiline(cin,s)){ | ^~~~~~~~ | getline a.cc:12:56: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] 12 | for(int i = 0; i < s.size(): i++){ | ^ a.cc:18:33: error: expected primary-expression before '}' token 18 | } | ^ a.cc:17:42: error: expected ';' before '}' token 17 | } | ^ | ; 18 | } | ~ a.cc:18:33: error: expected primary-expression before '}' token 18 | } | ^ a.cc:17:42: error: expected ')' before '}' token 17 | } | ^ | ) 18 | } | ~ a.cc:12:44: note: to match this '(' 12 | for(int i = 0; i < s.size(): i++){ | ^ a.cc:18:33: error: expected primary-expression before '}' token 18 | } | ^
s613247298
p00017
C++
#include <iostream> #include <string> using namespace std; int main(){ stirng s; while(getline(cin,s)){ while(s.find("the") == string::npos && s.find("this") == string::npos && s.find("that") == string::npos){ for(int i = 0; i < s.size(): i++){ if(s[i] == 'z') s[i] = 'a'; else if(s[i] >= 'a' && s[i] <= 'z') s[i]++; } } cout << s << endl; } }
a.cc: In function 'int main()': a.cc:6:9: error: 'stirng' was not declared in this scope 6 | stirng s; | ^~~~~~ a.cc:7:27: error: 's' was not declared in this scope 7 | while(getline(cin,s)){ | ^ a.cc:11:56: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] 11 | for(int i = 0; i < s.size(): i++){ | ^ a.cc:17:33: error: expected primary-expression before '}' token 17 | } | ^ a.cc:16:42: error: expected ';' before '}' token 16 | } | ^ | ; 17 | } | ~ a.cc:17:33: error: expected primary-expression before '}' token 17 | } | ^ a.cc:16:42: error: expected ')' before '}' token 16 | } | ^ | ) 17 | } | ~ a.cc:11:44: note: to match this '(' 11 | for(int i = 0; i < s.size(): i++){ | ^ a.cc:17:33: error: expected primary-expression before '}' token 17 | } | ^
s460736481
p00017
C++
#include <iostream> #include <string> using namespace std; int main() { string s; while (getline(cin, s)) { while (s.find("the" == s.npos && s.find("this") == s.npos && s.find("that") == s.npos) ) { for (int i = 0; i < s.size(); i++) { if (s[i] >= 'a' || 'y' <= s[i]) { s[i]++; } else { s[i] = 'a'; } } } cout << s << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 11 | while (s.find("the" == s.npos &&
s117949220
p00017
C++
#include <iostream> #include <cstdio> #include <cstring> using namespace std; void caesar(char* a) { for (int i=0; i<strlen(buf); i++) { if (c==' ' || c== '.') continue; else if (c=='z') buf[i] = 'a'; else buf[i]++; } } int main() { char buf[81]; for (int k=0; k<20; k++) { fgets(buf, 80, stdin); int len = strlen(buf); for (int i=0; i<26; i++) { if ( (strstr(buf, "the") != NULL) || (strstr(buf, "this") != NULL) || (strstr(buf, "that") != NULL) ) { cout << buf << endl; break; } caesar(buf); } } return 0; }
a.cc: In function 'void caesar(char*)': a.cc:9:32: error: 'buf' was not declared in this scope 9 | for (int i=0; i<strlen(buf); i++) { | ^~~ a.cc:10:21: error: 'c' was not declared in this scope 10 | if (c==' ' || c== '.') continue; | ^
s341413830
p00017
C++
#include <bits/stdc++.h> using namespace std; int main() { char line[100]; int dist,a,b,h,e,i,s,t,aa; while(gets(line)){ int l=strlen(line); //printf("length %d\n",l); char *token; token=strtok(line," "); while(token!=NULL) {//cout<<token<<" "; int tl=strlen(token); //printf("tl %d\n",tl); if(tl==3 || tl==4){ if(tl==3){ a=abs(token[0]-'t'); h=token[1]-'a'-a; h+=26; h=h%26; e=token[2]-'a'-a; e+=26; e=e%26; if(h+'a'=='h' && e+'a'=='e'){ dist = a; break; } } if(tl==4){ a=abs(token[0]-'t'); //printf("a %d\n",a); h=token[1]-'a'-a; h+=26; h=h%26; i=token[2]-'a'-a; i+=26; i=i%26; aa=token[2]-'a' -a; aa+=26; aa=aa%26; s=token[3]-'a'-a; s+=26; s=s%26; t=token[3]-'a' - a; a += 26; a = a%26; if(h+'a'=='h' && (i+'a'=='i' ||aa+'a'=='a') && (s+'a'=='s' || t+'a'=='t')){ dist = a; break; } } } token=strtok(NULL," "); } //printf("length %d\n",dist); for(int i=0;i<l;i++){ if(line[i]>='a' && line[i]<='z'){ a=line[i]-'a'; a=(a-dist); a+=26; a=a%26; line[i]='a'+a; printf("%c",a+'a'); } else printf("%c",line[i]); } printf("\n"); } return 0; }
a.cc: In function 'int main()': a.cc:9:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 9 | while(gets(line)){ | ^~~~ | getw
s025888594
p00017
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define ull unsigned long long #define pi acos(-1) #define MIN(a,b) (a < b ? a : b) #define MAX(a,b) (a > b ? a : b) int main() { char s[100],ch; int len,i,j,x,y,z,shift,m,c,shift1,shift2,shift3,shift4,shift5,shift6; while(gets(s)){ len=strlen(s); c=0; for(i=0;i<len;i++){ if(s[i]>='a'&&s[i]<='z'){ c++; } else{ if(c==3||c==4){ //printf("c:%d\n",c); if(c==3){ shift1=abs(s[i-3]-'t'); shift2=abs(s[i-2]-'h'); shift3=abs(s[i-1]-'e'); if(shift1==shift2&&shift2==shift3){ shift='t'-s[i-3]; printf("%c\n",s[i-3]); break; } } if(c==4){ shift1=abs(s[i-4]-'t'); //printf("%d %d\n",s[i-3],'t'); shift2=abs(s[i-3]-'h'); shift3=abs(s[i-2]-'i'); shift4=abs(s[i-1]-'s'); shift5=abs(s[i-2]-'a'); shift6=abs(s[i-1]-'t'); //printf("%d %d %d %d %d %d\n",shift1,shift2,shift3,shift4,shift5,shift6); if((shift1==shift2&&shift2==shift3&&shift3==shift4)||(shift1==shift2&&shift2==shift5&&shift5==shift6)){ //printf("%d\n",s[i]); shift='t'-s[i-4]; break; } } } c=0; } } //printf("%d\n",shift); for(i=0;i<len;i++){ if(s[i]>='a'&&s[i]<='z'){ m=s[i]-96; //printf("m:%d m+shift:%d\n",m,m+shift); if(m+shift>26)s[i]=(m+shift-26)+96; else if(m+shift<1)s[i]=96+(26+m+shift); else s[i]=96+m+shift; } } for(i=0;i<len;i++){ printf("%c",s[i]); } printf("\n"); memset(s,0,sizeof(s)); } return 0; }
a.cc: In function 'int main()': a.cc:12:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | while(gets(s)){ | ^~~~ | getw
s107733938
p00017
C++
#include<iostream> #include<stdio.h> #include<string> #include<math.h> #include<iomanip> #include<algorithm> #include<string.h> #include<cctype> #include<map> #include<set> #include<vector> #include<sstream> #include<stack> using namespace std; int main() { string a,b; while(cin>>a) { for(int shift=1;shift<26;shift++) { for(int i=0;i<a.length();i++) { if(a[i]>='a'&&a[i]<='z') { if(a[i]+shift>'z') b+=(a[i]+shift-26); else b+=(a[i]+shift) } else b+=a[i]; } if(a.find(the)||a.find(this)||a.find(that)) break; else continue; } for(int i=0;i<b.length();i++) { if(i>=80&&i%80==0) cout<<endl; cout<<b[i]<<endl; } } //while(1); return 0; }
a.cc: In function 'int main()': a.cc:30:32: error: expected ';' before '}' token 30 | else b+=(a[i]+shift) | ^ | ; 31 | } | ~ a.cc:34:18: error: 'the' was not declared in this scope 34 | if(a.find(the)||a.find(this)||a.find(that)) break; | ^~~ a.cc:34:31: error: invalid use of 'this' in non-member function 34 | if(a.find(the)||a.find(this)||a.find(that)) break; | ^~~~ a.cc:34:45: error: 'that' was not declared in this scope 34 | if(a.find(the)||a.find(this)||a.find(that)) break; | ^~~~
s471497305
p00017
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #include <vector> void q17() { vector<string> hints; hints.push_back("the"); hints.push_back("this"); hints.push_back("that"); vector< vector<string> > shiftHints; for (int i = 0; i < 26; i++) { vector<string> iShiftHints; for (int j = 0; j < hints.size(); j++) { string tmp = ""; for (int k = 0; k < hints[j].length(); k++) { char z = ((hints[j][k] - 'a' + i) % 26) + 'a'; tmp += ((hints[j][k] - 'a' + i) % 26) + 'a'; } iShiftHints.push_back(tmp); } shiftHints.push_back(iShiftHints); } string str; for (; getline(cin, str);) { int s; bool flag = false; for (s = 0; s < 26; s++) { for (int i = 0; i < hints.size(); i++) { if (str.find(shiftHints[s][i]) != -1) { flag = true; } } if (flag) break; } string ans = ""; for (int i = 0; i < str.length(); i++) { if ('a' <= str[i] && str[i] <= 'z') { ans += (str[i] - 'a' - s) % 26 + 'a'; } else { ans += str[i]; } } cout << ans << endl; break; } } int main() { q17(); return 0; }
a.cc: In function 'void q17()': a.cc:9:9: error: 'vector' was not declared in this scope 9 | vector<string> hints; | ^~~~~~ a.cc:9:9: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from a.cc:6: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:9:16: error: 'string' was not declared in this scope 9 | vector<string> hints; | ^~~~~~ a.cc:9:16: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:9:24: error: 'hints' was not declared in this scope 9 | vector<string> hints; | ^~~~~ a.cc:14:32: error: expected primary-expression before '>' token 14 | vector< vector<string> > shiftHints; | ^ a.cc:14:34: error: 'shiftHints' was not declared in this scope 14 | vector< vector<string> > shiftHints; | ^~~~~~~~~~ a.cc:16:32: error: 'iShiftHints' was not declared in this scope 16 | vector<string> iShiftHints; | ^~~~~~~~~~~ a.cc:18:31: error: expected ';' before 'tmp' 18 | string tmp = ""; | ^~~~ | ; a.cc:21:33: error: 'tmp' was not declared in this scope; did you mean 'tm'? 21 | tmp += ((hints[j][k] - 'a' + i) % 26) + 'a'; | ^~~ | tm a.cc:23:47: error: 'tmp' was not declared in this scope; did you mean 'tm'? 23 | iShiftHints.push_back(tmp); | ^~~ | tm a.cc:28:15: error: expected ';' before 'str' 28 | string str; | ^~~~ | ; a.cc:29:24: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 29 | for (; getline(cin, str);) { | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:29:29: error: 'str' was not declared in this scope; did you mean 'std'? 29 | for (; getline(cin, str);) { | ^~~ | std a.cc:41:23: error: expected ';' before 'ans' 41 | string ans = ""; | ^~~~ | ; a.cc:44:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 44 | ans += (str[i] - 'a' - s) % 26 + 'a'; | ^~~ | abs a.cc:47:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 47 | ans += str[i]; | ^~~ | abs a.cc:50:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 50 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:50:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 50 | cout << ans << endl; | ^~~ | abs a.cc:50:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 50 | cout << ans << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s398129681
p00017
C++
#include <iostream> #include <stdio.h> #include <string.h> #include <string> #include <algorithm> #include <vector> usinga namespace std; void q17() { vector<string> hints; hints.push_back("the"); hints.push_back("this"); hints.push_back("that"); vector< vector<string> > shiftHints; for (int i = 0; i < 26; i++) { vector<string> iShiftHints; for (int j = 0; j < hints.size(); j++) { string tmp = ""; for (int k = 0; k < hints[j].length(); k++) { tmp += ((hints[j][k] - 'a' + i) % 26) + 'a'; } iShiftHints.push_back(tmp); } shiftHints.push_back(iShiftHints); } string str; for (; getline(cin, str);) { int s; bool flag = false; for (s = 0; s < 26; s++) { for (int i = 0; i < hints.size(); i++) { if (str.find(shiftHints[s][i]) != -1) { flag = true; } } if (flag) break; } string ans = ""; for (int i = 0; i < str.length(); i++) { ans += isalpha(str[i]) ? (str[i] - 'a' - s + 26) % 26 + 'a' : str[i]; } cout << ans << endl; } } int main() { q17(); return 0; }
a.cc:8:1: error: 'usinga' does not name a type 8 | usinga namespace std; | ^~~~~~ a.cc: In function 'void q17()': a.cc:11:9: error: 'vector' was not declared in this scope 11 | vector<string> hints; | ^~~~~~ a.cc:11:9: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from a.cc:6: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:11:16: error: 'string' was not declared in this scope 11 | vector<string> hints; | ^~~~~~ a.cc:11:16: note: suggested alternatives: In file included from /usr/include/c++/14/iosfwd:41, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string' 77 | typedef basic_string<char> string; | ^~~~~~ In file included from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/string:76:11: note: 'std::pmr::string' 76 | using string = basic_string<char>; | ^~~~~~ a.cc:11:24: error: 'hints' was not declared in this scope 11 | vector<string> hints; | ^~~~~ a.cc:16:32: error: expected primary-expression before '>' token 16 | vector< vector<string> > shiftHints; | ^ a.cc:16:34: error: 'shiftHints' was not declared in this scope 16 | vector< vector<string> > shiftHints; | ^~~~~~~~~~ a.cc:18:32: error: 'iShiftHints' was not declared in this scope 18 | vector<string> iShiftHints; | ^~~~~~~~~~~ a.cc:20:31: error: expected ';' before 'tmp' 20 | string tmp = ""; | ^~~~ | ; a.cc:22:33: error: 'tmp' was not declared in this scope; did you mean 'tm'? 22 | tmp += ((hints[j][k] - 'a' + i) % 26) + 'a'; | ^~~ | tm a.cc:24:47: error: 'tmp' was not declared in this scope; did you mean 'tm'? 24 | iShiftHints.push_back(tmp); | ^~~ | tm a.cc:29:15: error: expected ';' before 'str' 29 | string str; | ^~~~ | ; a.cc:30:24: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 30 | for (; getline(cin, str);) { | ^~~ | std::cin /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked to standard input | ^~~ a.cc:30:29: error: 'str' was not declared in this scope; did you mean 'std'? 30 | for (; getline(cin, str);) { | ^~~ | std a.cc:42:23: error: expected ';' before 'ans' 42 | string ans = ""; | ^~~~ | ; a.cc:44:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 44 | ans += isalpha(str[i]) ? (str[i] - 'a' - s + 26) % 26 + 'a' : str[i]; | ^~~ | abs a.cc:46:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 46 | cout << ans << endl; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:46:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 46 | cout << ans << endl; | ^~~ | abs a.cc:46:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 46 | cout << ans << endl; | ^~~~ | std::endl /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s335697730
p00017
C++
#include <bits/stdc++.h> 2.using namespace std; 3.//???????????????????????????????????? 4.void Check(const string& str){ 5. string strparent=str; 6. int gap=1; 7. while(strparent.find("the")==(string::npos)&& 8. strparent.find("this")==(string::npos)&& 9. strparent.find("that")==(string::npos)){ 10. for(int i=0;i<str.length();i++){ 11. if(!isalpha(str[i]))continue;//" " 12. //strparent[i]=(gap+str[i]-'a')%26+'a'; 13. strparent[i]=(gap+str[i])%26+'a'; 14. } 15. gap++; 16. } 17. cout<<strparent<<endl; 18.} 19. 20.int main(){ 21. string str; 22. while(getline(cin,str)){ 23. Check(str); 24. } 25.}
a.cc:3:1: error: expected unqualified-id before numeric constant 3 | 2.using namespace std; | ^~~~~~~ a.cc:5:1: error: expected unqualified-id before numeric constant 5 | 3.//???????????????????????????????????? | ^~ a.cc:37:1: error: expected unqualified-id before numeric constant 37 | 19. | ^~~
s095295561
p00017
C++
#include <bits/stdc++.h> using namespace std; #define FOR(i, j, k) for(int i = j; i < k; ++i) #define rep(i, j) FOR(i, 0, j) #define repr(i, j) for(int i = j; i >= 0; --i) #define INF (1 << 30) #define MOD 1e9 + 7 typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; int main() { string s; bool flag = false; int key = 1; while(getline(cin, s)){ while(s.find("this") == string::nops && s.find("that") == string::nops && s.find("the") == string::nops) { rep(i, s.size()) { if(97 <= s[i] && s[i] <= 122) { int number = (s[i] - 'a' + key) % 26; s[i] = 'a' + number; } } } cout << s << endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:41: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 20 | while(s.find("this") == string::nops && s.find("that") == string::nops && s.find("the") == string::nops) { | ^~~~ a.cc:20:75: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 20 | while(s.find("this") == string::nops && s.find("that") == string::nops && s.find("the") == string::nops) { | ^~~~ a.cc:20:108: error: 'nops' is not a member of 'std::string' {aka 'std::__cxx11::basic_string<char>'} 20 | while(s.find("this") == string::nops && s.find("that") == string::nops && s.find("the") == string::nops) { | ^~~~
s542182501
p00017
C++
#include <cassert> #include <iostream> #include <string> bool IsValid(const std::string& Text) { return Text.find("the") != std::string::npos || Text.find("this") != std::string::npos || Text.find("that") != std::string::npos; } std::string RotateChar(const std::string& Code, int Key) { std::string Text = Code; for(std::size_t i = 0; i < Text.size(); ++i){ if(Text[i] == ',' || Text[i] == '.' || Text[i] == ' '){ continue; } int c = Text[i] + Key; if(c < 'a') c += 26; if(c > 'z') c -= 26; Text[i] = c; } return Text; } std::string Decrypt(const std::string& Code) { for(int i = 0; i < 26; ++i){ std::string Text = RotateChar(Code, i); if(IsValid(Text)){ return Text; } }
a.cc: In function 'std::string Decrypt(const std::string&)': a.cc:35:6: error: expected '}' at end of input 35 | } | ^ a.cc:29:1: note: to match this '{' 29 | { | ^ a.cc:35:6: warning: control reaches end of non-void function [-Wreturn-type] 35 | } | ^
s679019264
p00017
C++
#include <cassert> #include <iostream> #include <string> bool IsValid(const std::string& Text) { return Text.find("the") != std::string::npos || Text.find("this") != std::string::npos || Text.find("that") != std::string::npos; } std::string RotateChar(const std::string& Code, int Key) { std::string Text = Code; for(std::size_t i = 0; i < Text.size(); ++i){ if(Text[i] == ',' || Text[i] == '.' || Text[i] == ' '){ continue; } int c = Text[i] + Key; if(c < 'a') c += 26; if(c > 'z') c -= 26; Text[i] = c; } return Text; } std::string Decrypt(const std::string& Code) { for(int i = 0; i < 26; ++i){ std::string Text = RotateChar(Code, i); if(IsValid(Text)){ return Text; } }
a.cc: In function 'std::string Decrypt(const std::string&)': a.cc:35:6: error: expected '}' at end of input 35 | } | ^ a.cc:29:1: note: to match this '{' 29 | { | ^ a.cc:35:6: warning: control reaches end of non-void function [-Wreturn-type] 35 | } | ^
s899769718
p00017
C++
#include<bits/stdc++.h> using namespace std; int main(){ string str[80]; vector<int> num; while(cin>>str[i]){ if(str[i].size()==4||str[i].size()==3) num.push_back((str[i].size()*100)+i); } int flag=0,zure=0; for(int i=0;i<num.size();i++){ if(num[i]/100==3){ for(int j=0;j<3;j++){ for(int k=1;k<26;k++){ if(str[num[i]-300][0]=='t'+k){ if(str[num[i]-300][1]=='h'+k&&str[num[i]-300][2]=='e'+k){ zure=k;flag=1;break; } } } if(flag==1) break; } if(flag==1) break; } else{ for(int j=0;j<4;j++){ for(int k=1;k<26;k++){ if(str[num[i]-400][0]=='t'+k&&str[num[i]-400][1]=='h'+k){ if(str[num[i]-400][2]=='i'+k&&str[num[i]-400][3]=='s'+k||str[num[i]-400][2]=='a'+k&&str[num[i]-400][2]=='t'+k){ zure=k;flag=1;break; } } } if(flag==1) break; } if(flag==1) break; } } for(int j=0;j<10;j++){ for(int k=0;k<str[j].size();k++){ str[j][k]=str[j][k]+zure; } } for(int j=0;j<10;j++){ cout<<str[j]; if(j!=10) cout<<" "; }cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:6:18: error: 'i' was not declared in this scope 6 | while(cin>>str[i]){ | ^
s443131186
p00017
C++
//Vol0 0017 #include<stdio.h> #include<string.h> #include<ctype.h> int main() { char s[128]; int i,j,k; int c; while((gets(s))!=NULL){ c=1; for(i=0;i<26;i++){ for(j=0;j<strlen(s);j++){ if(isalpha(s[j])){ if(s[j]=='z'){ s[j]='a'; }else{ s[j]++; } } } for(k=0;k<strlen(s)-1;k++){ if((s[k]=='t')&&(s[k+1]=='h')){ if(c){ c=0; printf("%s\n",s); } } } } } return 0; }
a.cc: In function 'int main()': a.cc:10:16: error: 'gets' was not declared in this scope; did you mean 'getw'? 10 | while((gets(s))!=NULL){ | ^~~~ | getw
s043645557
p00017
C++
#include <stdio.h> #include <math.h> #include <string.h> #define JUDGE(x) (strstr(change,x)) int main(){ int i,j; char str[100],change[100]; while (gets(str) != NULL) { for (i=0; i<26; i++) { for (j=0; j<strlen(str); j++) { if(str[j]>='a' && str[j]<='z') change[j] = str[j]+i >'z'? str[j]+i-26: str[j]+i; else change[j] = str[j]; } if (JUDGE("this") || JUDGE("that") || JUDGE("the")) { puts(change); break; } } memset(str, '\0', sizeof(str)); memset(change,'\0', sizeof(change)); } return 0; }
a.cc: In function 'int main()': a.cc:12:12: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | while (gets(str) != NULL) { | ^~~~ | getw
s237242278
p00017
C++
#include <cstdio> #include <string> using namespace std; char str[128] = { 0 }; inline char nxt(char c) { if (c == 'z') { c = 'a'; } else if (c >= 'a' && c < 'z') { c++; } return c; } bool find() { int p = 0; while (str[p] != '\0') { if (str[p] == 't' && str[p + 1] == 'h') { if (str[p + 2] == 'e') { return true; } else if (str[p + 2] == 'i' && str[p + 3] == 's') { return true; } else if (str[p + 2] == 'a' && str[p + 3] == 't') { return true; } } p++; } return false; } int main(){ while (fgets(str, sizeof(str), stdin) != NULL) { str[strlen(str) - 1] = '\0'; for (int i = 0; i < 25; i++) { int p = 0; while (str[p] != '\0') { str[p] = nxt(str[p]); p++; } if (find()) { printf("%s", str); break; } } } return 0; }
a.cc: In function 'int main()': a.cc:38:21: error: 'strlen' was not declared in this scope 38 | str[strlen(str) - 1] = '\0'; | ^~~~~~ a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <string> +++ |+#include <cstring> 3 | using namespace std;
s984484497
p00017
C++
import java.io.*; public class main{ public static void main(String[] args) throws IOException{ try{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); String str; String target[]; int checkResult = 99; int caesar; while( (str = br.readLine()) != null){ caesar = 0; target = str.split(" "); for(int i = 0; i < target.length; i++){ checkResult = checkPattern(target[i]); if(checkResult != 99){ caesar = checkResult; break; } } StringBuilder result = new StringBuilder(); for(int i = 0; i < target.length; i++){ result.append(makeCaeserString(target[i],caesar)); result.append(" "); } System.out.println(result); } }catch(Exception e){ System.out.println(e); } } private static int checkPattern(String str){ String target[]; target = str.split("\\."); int result = 99; for(int i = 0; i < target.length; i++){ result = isThe(target[i]); if(result != 99) break; result = isThis(target[i]); if(result != 99) break; result = isThat(target[i]); if(result != 99) break; } return result; } private static int isThe(String str){ String newStr; String target = "the"; int result = 99; if(str.length() != target.length()) return result; for(int i = -26; i < 27; i++){ //str.charAt(j)???str???j???????????????????????? newStr = String.valueOf((char)(str.charAt(0)+i)) + String.valueOf((char)(str.charAt(1)+i)) + String.valueOf((char)(str.charAt(2)+i)); if( newStr.equals(target) ){ result = i; break; } } return result; } private static int isThis(String str){ String newStr; String target = "this"; int result = 99;; if(str.length() != target.length()) return result; for(int i = -26; i < 27; i++){ //str.charAt(j)???str???j???????????????????????? newStr = String.valueOf((char)(str.charAt(0)+i)) + String.valueOf((char)(str.charAt(1)+i)) + String.valueOf((char)(str.charAt(2)+i)) + String.valueOf((char)(str.charAt(3)+i)); if( newStr.equals(target) ){ result = i; break; } } return result; } private static int isThat(String str){ String newStr; String target = "that"; int result = 99;; if(str.length() != target.length()) return result; for(int i = -26; i < 27; i++){ //str.charAt(j)???str???j???????????????????????? newStr = String.valueOf((char)(str.charAt(0)+i)) + String.valueOf((char)(str.charAt(1)+i)) + String.valueOf((char)(str.charAt(2)+i)) + String.valueOf((char)(str.charAt(3)+i)); if( newStr.equals(target) ){ result = i; break; } } return result; } private static String makeCaeserString(String str,int n){ int intA = 'a'; int intZ = 'z'; int zure = 0; String result = ""; for(int i = 0; i < str.length(); i++){ if(str.charAt(i)<intA || str.charAt(i) > intZ){ return str; }else if( (str.charAt(i)) == ".".charAt(0)){ zure = -n; }else if( str.charAt(i) + n < intA ){ zure = 26; }else if(str.charAt(i) + n > intZ){ zure = -26; } result += String.valueOf((char)(str.charAt(i)+n+zure)); zure = 0; } return result; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class main{ | ^~~~~~
s681401172
p00017
C++
import java.io.*; public class Main{ public static void main(String[] args) throws IOException{ try{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); String str; String target[]; int checkResult = 99; int caesar; while( (str = br.readLine()) != null){ caesar = 0; target = str.split(" "); for(int i = 0; i < target.length; i++){ checkResult = checkPattern(target[i]); if(checkResult != 99){ caesar = checkResult; break; } } StringBuilder result = new StringBuilder(); for(int i = 0; i < target.length; i++){ result.append(makeCaeserString(target[i],caesar)); result.append(" "); } System.out.println(result); } }catch(Exception e){ System.out.println(e); } } private static int checkPattern(String str){ String target[]; target = str.split("\\."); int result = 99; for(int i = 0; i < target.length; i++){ result = isThe(target[i]); if(result != 99) break; result = isThis(target[i]); if(result != 99) break; result = isThat(target[i]); if(result != 99) break; } return result; } private static int isThe(String str){ String newStr; String target = "the"; int result = 99; if(str.length() != target.length()) return result; for(int i = -26; i < 27; i++){ //str.charAt(j)???str???j???????????????????????? newStr = String.valueOf((char)(str.charAt(0)+i)) + String.valueOf((char)(str.charAt(1)+i)) + String.valueOf((char)(str.charAt(2)+i)); if( newStr.equals(target) ){ result = i; break; } } return result; } private static int isThis(String str){ String newStr; String target = "this"; int result = 99;; if(str.length() != target.length()) return result; for(int i = -26; i < 27; i++){ //str.charAt(j)???str???j???????????????????????? newStr = String.valueOf((char)(str.charAt(0)+i)) + String.valueOf((char)(str.charAt(1)+i)) + String.valueOf((char)(str.charAt(2)+i)) + String.valueOf((char)(str.charAt(3)+i)); if( newStr.equals(target) ){ result = i; break; } } return result; } private static int isThat(String str){ String newStr; String target = "that"; int result = 99;; if(str.length() != target.length()) return result; for(int i = -26; i < 27; i++){ //str.charAt(j)???str???j???????????????????????? newStr = String.valueOf((char)(str.charAt(0)+i)) + String.valueOf((char)(str.charAt(1)+i)) + String.valueOf((char)(str.charAt(2)+i)) + String.valueOf((char)(str.charAt(3)+i)); if( newStr.equals(target) ){ result = i; break; } } return result; } private static String makeCaeserString(String str,int n){ int intA = 'a'; int intZ = 'z'; int zure = 0; String result = ""; for(int i = 0; i < str.length(); i++){ if(str.charAt(i)<intA || str.charAt(i) > intZ){ return str; }else if( (str.charAt(i)) == ".".charAt(0)){ zure = -n; }else if( str.charAt(i) + n < intA ){ zure = 26; }else if(str.charAt(i) + n > intZ){ zure = -26; } result += String.valueOf((char)(str.charAt(i)+n+zure)); zure = 0; } return result; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s469059659
p00017
C++
import Control.Applicative import Data.Char (readLitChar) import Data.List import System.IO main = do eof <- isEOF if eof then return () else do dataset <- getLine mapM_ putStrLn $ decodeCaesar (escape dataset) main shiftChar :: Int -> Char -> Char shiftChar n c | c == '.' = '.' | c == ' ' = ' ' | c == '\n' = '\n' | otherwise = toEnum.(+97).(`mod` 26).(+ n).(subtract 97).fromEnum $ c shiftString :: Int -> String -> String shiftString n = map (shiftChar n) decodeCaesar :: String -> [String] decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) $ map shiftString [1..25] <*> [str] escape :: String -> String escape [] = [] escape str = x : escape rest where [(x,rest)] = readLitChar str
a.cc:19:33: error: stray '`' in program 19 | | otherwise = toEnum.(+97).(`mod` 26).(+ n).(subtract 97).fromEnum $ c | ^ a.cc:19:37: error: stray '`' in program 19 | | otherwise = toEnum.(+97).(`mod` 26).(+ n).(subtract 97).fromEnum $ c | ^ a.cc:25:28: error: stray '\' in program 25 | decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) | ^ a.cc:25:42: error: stray '`' in program 25 | decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) | ^ a.cc:25:52: error: stray '`' in program 25 | decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) | ^ a.cc:25:68: error: stray '`' in program 25 | decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) | ^ a.cc:25:78: error: stray '`' in program 25 | decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) | ^ a.cc:25:93: error: stray '`' in program 25 | decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) | ^ a.cc:25:103: error: stray '`' in program 25 | decodeCaesar str = filter (\s -> ("this" `isInfixOf` s) || ("that" `isInfixOf` s) || ("the" `isInfixOf` s)) | ^ a.cc:26:24: error: too many decimal points in number 26 | $ map shiftString [1..25] <*> [str] | ^~~~~ a.cc:1:1: error: 'import' does not name a type 1 | import Control.Applicative | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s025849205
p00017
C++
a='abcdefghijklmnopqrstuvwxy' b=input() for i in range(26): c=''.join(a[ord(e)-97-i]if e in a else e for e in b) if any(('the 'in c,'this 'in c,'that 'in c)):print(c);break
a.cc:1:3: warning: multi-character literal with 25 characters exceeds 'int' size of 4 bytes 1 | a='abcdefghijklmnopqrstuvwxy' | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:4:4: error: empty character constant 4 | c=''.join(a[ord(e)-97-i]if e in a else e for e in b) | ^~ a.cc:5:10: warning: multi-character character constant [-Wmultichar] 5 | if any(('the 'in c,'this 'in c,'that 'in c)):print(c);break | ^~~~~~~~ a.cc:5:21: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 5 | if any(('the 'in c,'this 'in c,'that 'in c)):print(c);break | ^~~~~~~~~ a.cc:5:33: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes 5 | if any(('the 'in c,'this 'in c,'that 'in c)):print(c);break | ^~~~~~~~~ a.cc:1:1: error: 'a' does not name a type 1 | a='abcdefghijklmnopqrstuvwxy' | ^ a.cc:5:56: error: expected unqualified-id before 'break' 5 | if any(('the 'in c,'this 'in c,'that 'in c)):print(c);break | ^~~~~
s387874209
p00017
C++
import java.util.*; import static java.lang.System.*; import java.math.*; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { String s = sc.nextLine(); for (int i=0; i<26; i++) { StringBuilder sb = new StringBuilder(); char c; for (int j=0; j<s.length(); j++) { c = s.charAt(j); if (c!='.' && c!=' ') { c -= i; if (c < 97) {c+=26;} } sb.append(c); } if (sb.toString().matches(".*(the|this|that).*")) {out.println(sb);} } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import static java.lang.System.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.math.*; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:5:1: error: expected unqualified-id before 'public' 5 | public class Main { | ^~~~~~
s289695066
p00017
C++
#include <iostream> #include <cstdio> using namespace std; int main() { // char c = 'x'; // char d = '|'; // char e = 'm'; // // printf("%d %d %d\n", c, d, e); // // c = 't'; // d = 'h'; // e = 'i'; // // printf("%d %d %d\n", c, d, e); char s[80 + 7]; char ans[80 + 7]; while(gets(s)) { int k = 0; for(int i = 0; s[i]; i++) { if(s[i] >= 'a' && s[i] <= 'z') { ans[k] = s[i] - 4; k++; } else { ans[k] = s[i]; k++; } } ans[k] = '\0'; puts(ans); } return 0; }
a.cc: In function 'int main()': a.cc:23:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 23 | while(gets(s)) | ^~~~ | getw
s733030437
p00017
C++
#include <stdio.h> #include<string.h> int main() { char a[200]; int i,b,x,l,c,in; while(gets(a)!=EOF) { l=strlen(a); b=(int)a[0]; x=116-b; for(i=0;i<l;i++) { if(a[i]>=97&&a[i]<=122) { in=(int)a[i]; a[i]=in+x; } printf("%c",a[i]); } printf("\n");} return 0; }
a.cc: In function 'int main()': a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | while(gets(a)!=EOF) | ^~~~ | getw
s826777708
p00017
C++
#include<stdio.h> #include<string.h> #include<math.h> #include<iostream> #include<algorithm> #include<set> #include<queue> #include<string> #include<vector> #include<map> #include<stack> #include<list> using namespace std; #define inf 0x3f3f3f3f char d[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; int main(){ char s[110]; char c; int i=0; gets(s); int l = strlen(s),j,k,m,t; for(i=0;i<=26;i++){ char t[110]={'a'}; for(j=0;j<l;j++){ if(s[j]>='a'&&s[j]<='z'){ t[j] = d[(s[j]-'a'+i)%26]; } else t[j] =s[j]; } int a=0,b=0,c=0; for(j=0;j<l-2;j++){ if(t[j]=='t'&&t[j+1]=='h'){ if(t[j+2]=='e'&&!(t[j+3]>='a' && t[j+3]<='z')){ a++; } if(t[j+2]=='i'&&t[j+3]=='s'&&!(t[j+4]>='a'&&t[j+4]<='z')){ b++; } if(t[j+2]=='a'&&t[j+3]=='t'&&!(t[j+4]>='a'&&t[j+4]<='z')){ c++; } } } if(a&&b&&c)break; } for(j=0;j<l;j++){ if(s[j]>='a'&&s[j]<='z'){ printf("%c",d[(s[j]-'a'+i)%26]); } else printf("%c",s[j]); } puts(""); return 0; }
a.cc: In function 'int main()': a.cc:22:9: error: 'gets' was not declared in this scope; did you mean 'getw'? 22 | gets(s); | ^~~~ | getw
s075313299
p00017
C++
#include<stdio.h> #include<string> #include<stdlib.h> int main() { int i,l; char ch[90]; while(1){ getline(cin,ch); l=strlen(ch); for(i=0;i<l;i++){ if(ch[i]>='a'&&ch[i]<='z'){ if(ch[i]=='a'||ch[i]=='b'||ch[i]=='c'||ch[i]=='d'){ if(ch[i]=='a'){ ch[i]='w'; } else if(ch[i]=='b'){ ch[i]='x'; } else if(ch[i]=='c'){ ch[i]='y'; } else if(ch[i]=='d'){ ch[i]='z'; } } else { ch[i]=ch[i]-4; } } } printf("%s\n",ch); } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'cin' was not declared in this scope 9 | getline(cin,ch); | ^~~ a.cc:10:3: error: 'strlen' was not declared in this scope 10 | l=strlen(ch); | ^~~~~~ a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<stdlib.h> +++ |+#include <cstring> 4 | int main()
s605480526
p00017
C++
#include<stdio.h> #include<string.h> void Roll(char ch[], int times) { int cnt = 0; while (ch[cnt] != 0) { if (96 < ch[cnt] && 123 > ch[cnt]) ch[cnt] = (ch[cnt] - 97 + times) % 26 + 97; cnt++; } } int main() { char inp[100]; char buff[80]; int pos = 0, bpos = 0; while (1) { if (gets_s(inp, 100) == NULL)break; while (1) { if (96 < inp[pos] && 123 > inp[pos]) { buff[bpos] = inp[pos]; bpos++; pos++; } else { buff[bpos] = '\0'; if (strlen(buff) != 3 && strlen(buff) != 4) { bpos = 0; continue; } Roll(buff, 116 - inp[0]); if (strcmp(buff, "this") == 0 || strcmp(buff, "that") == 0 || strcmp(buff, "the") == 0) { Roll(inp, 116 - inp[0]); break; } else { bpos = 0; continue; } } } puts(inp); } return 0; }
a.cc: In function 'int main()': a.cc:20:21: error: 'gets_s' was not declared in this scope 20 | if (gets_s(inp, 100) == NULL)break; | ^~~~~~
s519079196
p00017
C++
#include<stdio.h> #include<string.h> int main(){ char s[85]; int i; memset(s,'0',sizeof(s)); while(gets(s)){ while(1){ for(i=0;i<81;i++){ switch(s[i]){ case '.': case ' ': case '0': case '\0': case 10: case 13: continue; } s[i]='a'+(s[i]-'a'+1)%26; } if((NULL!=strstr(s,"the")) || (NULL!=strstr(s,"this")) || (NULL!=strstr(s,"that"))){ printf("%s\n",s); memset(s,'0',sizeof(s)); break; } } } return 0; }
a.cc: In function 'int main()': a.cc:8:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 8 | while(gets(s)){ | ^~~~ | getw
s765777898
p00017
C++
#include <iostream> #include <cstring> using namespace std; int main(int argc, char **argv) { char a[82], t; int n, p; while(gets(a)!=NULL){ n = strlen(a); for(int i = 0; i < n; i++){ p = (int)(a[i++]-'t'); if(a[i] == ' '){ continue; } t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(a[i] == ' '){ continue; } if(t == 'h'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 'e' && a[i] == ' '){ break; } else if(t == 'i'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 's' && a[i] == ' '){ break; } } else if(t == 'a'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 't' && a[i] == ' '){ break; } } } } for(int i = 0; i < n; i++){ if(a[i] == ' ' || a[i] == '.' || a[i] == ','){ printf("%c",a[i]); } else { t = a[i]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } printf("%c",t); } } cout << endl; } return 0; }
a.cc: In function 'int main(int, char**)': a.cc:11:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 11 | while(gets(a)!=NULL){ | ^~~~ | getw
s056494399
p00017
C++
#include <iostream> #include <cstring> #include <string> #include <cstdlib> using namespace std; int main(int argc, char **argv) { char a[82], t; int n, p; while(gets(a)!=NULL){ n = strlen(a); for(int i = 0; i < n; i++){ p = (int)(a[i++]-'t'); if(a[i] == ' '){ continue; } t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(a[i] == ' '){ continue; } if(t == 'h'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 'e' && a[i] == ' '){ break; } else if(t == 'i'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 's' && a[i] == ' '){ break; } } else if(t == 'a'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 't' && a[i] == ' '){ break; } } } } for(int i = 0; i < n; i++){ if(a[i] == ' ' || a[i] == '.' || a[i] == ','){ printf("%c",a[i]); } else { t = a[i]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } printf("%c",t); } } cout << endl; } return 0; }
a.cc: In function 'int main(int, char**)': a.cc:13:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | while(gets(a)!=NULL){ | ^~~~ | getw
s937520879
p00017
C++
#include <iostream> #include <cstring> #include <istream> using namespace std; int main(int argc, char **argv) { char a[82], t; int n, p; while(gets(a)!=NULL){ n = strlen(a); for(int i = 0; i < n; i++){ p = (int)(a[i++]-'t'); if(a[i] == ' '){ continue; } t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(a[i] == ' '){ continue; } if(t == 'h'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 'e' && a[i] == ' '){ break; } else if(t == 'i'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 's' && a[i] == ' '){ break; } } else if(t == 'a'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 't' && a[i] == ' '){ break; } } } } for(int i = 0; i < n; i++){ if(a[i] == ' ' || a[i] == '.' || a[i] == ','){ printf("%c",a[i]); } else { t = a[i]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } printf("%c",t); } } cout << endl; } return 0; }
a.cc: In function 'int main(int, char**)': a.cc:12:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | while(gets(a)!=NULL){ | ^~~~ | getw
s301283803
p00017
C++
#include <iostream> #include <cstring> #include <cstdio> using namespace std; int main(int argc, char **argv) { char a[82], t; int n, p; while(gets(a)!=NULL){ n = strlen(a); for(int i = 0; i < n; i++){ p = (int)(a[i++]-'t'); if(a[i] == ' '){ continue; } t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(a[i] == ' '){ continue; } if(t == 'h'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 'e' && a[i] == ' '){ break; } else if(t == 'i'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 's' && a[i] == ' '){ break; } } else if(t == 'a'){ t = a[i++]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } if(t == 't' && a[i] == ' '){ break; } } } } for(int i = 0; i < n; i++){ if(a[i] == ' ' || a[i] == '.' || a[i] == ','){ printf("%c",a[i]); } else { t = a[i]-p; if(t < 'a'){ t += 25; } else if(t > 'z'){ t -= 25; } printf("%c",t); } } cout << endl; } return 0; }
a.cc: In function 'int main(int, char**)': a.cc:12:15: error: 'gets' was not declared in this scope; did you mean 'getw'? 12 | while(gets(a)!=NULL){ | ^~~~ | getw
s805398192
p00017
C++
#include<iostream> #include<string> int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}
a.cc: In function 'int main()': a.cc:3:79: error: 'strcpy' was not declared in this scope 3 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ a.cc:2:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cstring> 2 | #include<string> a.cc:3:114: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 3 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ | strtoq a.cc:3:149: error: 'strlen' was not declared in this scope 3 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ a.cc:3:149: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s029639724
p00017
C++
#include<iostream> #include<string> #include<cmath> int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}
a.cc: In function 'int main()': a.cc:4:79: error: 'strcpy' was not declared in this scope 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<cmath> +++ |+#include <cstring> 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} a.cc:4:114: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ | strtoq a.cc:4:149: error: 'strlen' was not declared in this scope 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ a.cc:4:149: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s250722471
p00017
C++
#include<iostream> #include<string> #include<cstdio> int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}}
a.cc: In function 'int main()': a.cc:4:79: error: 'strcpy' was not declared in this scope 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<cstdio> +++ |+#include <cstring> 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} a.cc:4:114: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ | strtoq a.cc:4:149: error: 'strlen' was not declared in this scope 4 | int main(){std::string s;while(std::getline(std::cin,s)){char b[81],*p,*c;c=b;strcpy(b,s.c_str());int gap=0;do{p=strtok(c," .\n");if(p!=NULL){int l=strlen(p);if(l>=3&&p[0]-p[1]=='t'-'h'){if(l==3){if(p[0]-p[2]=='t'-'e'){gap='t'-p[0];break;}}else if(l==4){if(p[0]-p[2]=='t'-'i'&&p[0]-p[3]=='t'-'s'){gap='t'-p[0];break;}else if(p[0]-p[2]=='t'-'a'&&p[0]-p[3]==0){gap='t'-p[0];break;}}}}c=NULL;}while(p!=NULL);for(std::string::iterator it=s.begin();it!=s.end();++it){if(*it!=' '&&*it!='.'&&*it!='\n'){std::cout<<static_cast<char>(*it+gap);}else{std::cout<<*it;}}}} | ^~~~~~ a.cc:4:149: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
s509965279
p00017
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> using namespace std; typedef long long Int; typedef vector<int> vint; typedef pair<int,int> pint; #define mp make_pair template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; } template<class T> void chmin(T &t, T f) { if (t > f) t = f; } template<class T> void chmax(T &t, T f) { if (t < f) t = f; } int in() { int x; scanf("%d", &x); return x; } int main() { string str; char chr[100]; for(;gets(chr);){ str=chr; int len=str.size(); int i,c; for(c=1;c<=26;c++){ for(i=0;i<len;i++){ if('a'<=str[i]&&str[i]<='z'){ str[i]++; if(str[i]>'z')str[i]='a'; } } //cout<<str<<endl; if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){ cout<<str<<endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:34:14: error: 'gets' was not declared in this scope; did you mean 'getw'? 34 | for(;gets(chr);){ | ^~~~ | getw
s803695492
p00017
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> using namespace std; typedef long long Int; typedef vector<int> vint; typedef pair<int,int> pint; #define mp make_pair template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; } template<class T> void chmin(T &t, T f) { if (t > f) t = f; } template<class T> void chmax(T &t, T f) { if (t < f) t = f; } int in() { int x; scanf("%d", &x); return x; } int main() { string str; char chr[100]; for(;gets(chr);){ str=chr; int len=str.size(); int i,c; for(c=1;c<=26;c++){ for(i=0;i<len;i++){ if('a'<=str[i]&&str[i]<='z'){ str[i]++; if(str[i]>'z')str[i]='a'; } } //cout<<str<<endl; //if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){ cout<<str<<endl; break; // } } } return 0; }
a.cc: In function 'int main()': a.cc:34:14: error: 'gets' was not declared in this scope; did you mean 'getw'? 34 | for(;gets(chr);){ | ^~~~ | getw
s584856797
p00017
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> using namespace std; typedef long long Int; typedef vector<int> vint; typedef pair<int,int> pint; #define mp make_pair template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; } template<class T> void chmin(T &t, T f) { if (t > f) t = f; } template<class T> void chmax(T &t, T f) { if (t < f) t = f; } int in() { int x; scanf("%d", &x); return x; } int main() { string str; char chr[100]; for(;gets(chr);){ str=(string)(chr); int len=str.size(); int i,c; for(c=1;c<=26;c++){ for(i=0;i<len;i++){ if('a'<=str[i]&&str[i]<='z'){ str[i]++; if(str[i]>'z')str[i]='a'; } } cout<<str<<endl; //if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){ cout<<str<<endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:34:14: error: 'gets' was not declared in this scope; did you mean 'getw'? 34 | for(;gets(chr);){ | ^~~~ | getw a.cc: At global scope: a.cc:52:9: error: expected unqualified-id before 'return' 52 | return 0; | ^~~~~~ a.cc:53:1: error: expected declaration before '}' token 53 | } | ^
s157264146
p00017
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> using namespace std; typedef long long Int; typedef vector<int> vint; typedef pair<int,int> pint; #define mp make_pair template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; } template<class T> void chmin(T &t, T f) { if (t > f) t = f; } template<class T> void chmax(T &t, T f) { if (t < f) t = f; } int in() { int x; scanf("%d", &x); return x; } int main() { string str; char chr[100]; for(;gets(chr);){ str=(string)(chr); int len=str.size(); int i,c; for(c=1;c<=26;c++){ for(i=0;i<len;i++){ if('a'<=str[i]&&str[i]<='z'){ str[i]++; if(str[i]>'z')str[i]='a'; } } //cout<<str<<endl; if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){ cout<<str<<endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:34:14: error: 'gets' was not declared in this scope; did you mean 'getw'? 34 | for(;gets(chr);){ | ^~~~ | getw
s049459085
p00017
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> using namespace std; typedef long long Int; typedef vector<int> vint; typedef pair<int,int> pint; #define mp make_pair template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; } template<class T> void chmin(T &t, T f) { if (t > f) t = f; } template<class T> void chmax(T &t, T f) { if (t < f) t = f; } int in() { int x; scanf("%d", &x); return x; } int main() { string str; for(;getline(cin,str)&eofbit;){ int len=str.size(); int i,c; for(c=1;c<=26;c++){ for(i=0;i<len;i++){ if('a'<=str[i]&&str[i]<='z'){ str[i]++; if(str[i]>'z')str[i]='a'; } } //cout<<str<<endl; if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){ cout<<str<<endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:33:31: error: 'eofbit' was not declared in this scope 33 | for(;getline(cin,str)&eofbit;){ | ^~~~~~
s007687804
p00017
C++
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<cassert> #include<iostream> #include<sstream> #include<string> #include<vector> #include<queue> #include<set> #include<map> #include<utility> #include<numeric> #include<algorithm> #include<bitset> #include<complex> using namespace std; typedef long long Int; typedef vector<int> vint; typedef pair<int,int> pint; #define mp make_pair template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; } template<class T> void chmin(T &t, T f) { if (t > f) t = f; } template<class T> void chmax(T &t, T f) { if (t < f) t = f; } int in() { int x; scanf("%d", &x); return x; } int main() { string str; for(;getline(cin,str)&eofbit;){ /*int len=str.size(); int i,c; for(c=1;c<=26;c++){ for(i=0;i<len;i++){ if('a'<=str[i]&&str[i]<='z'){ str[i]++; if(str[i]>'z')str[i]='a'; } } //cout<<str<<endl; if(str.find("the")!=string::npos||str.find("this")!=string::npos||str.find("that")!=string::npos){ cout<<str<<endl; break; } }*/ } return 0; }
a.cc: In function 'int main()': a.cc:33:31: error: 'eofbit' was not declared in this scope 33 | for(;getline(cin,str)&eofbit;){ | ^~~~~~
s731426579
p00017
C++
#include <cstdio> #include <cstring> #include <algorithm> #include <string> #include <cmath> #include <stack> #include <vector> int main() { char s[81]; while (gets(s) != NULL) { for (int i = 0; i < 26; ++i) { char decoded[81]; for (int j = 0; s[j] != '\0'; ++j) decoded[j] = islower(s[j]) ? 'a'+(s[j]-'a'+i)%26 : s[j]; decoded[strlen(s)] = '\0'; if (strstr(decoded, "the") || strstr(decoded, "this") || strstr(decoded, "that")) { puts(decoded); break; } } } return 0; }
a.cc: In function 'int main()': a.cc:13:16: error: 'gets' was not declared in this scope; did you mean 'getw'? 13 | while (gets(s) != NULL) | ^~~~ | getw
s109174208
p00017
C++
// AOJClearQuestion.cpp : ƒƒCƒ“ ƒvƒƒWƒFƒNƒg ƒtƒ@ƒCƒ‹‚Å‚·B #include "stdafx.h" #include <iostream> #include <string> #include <algorithm> #include <map> using namespace std; int main(){ string s,d; while(getline(cin,s)){ for(int j=0;j<26;j++){ for(int i=0;i<s.size();i++){ if(s[i]>='a'&&s[i]<='z'){ s[i]=(s[i]=='z')?'a':s[i]+1; } } if(s.find("the")!=string::npos||s.find("this")!=string::npos||s.find("that")!=string::npos){ cout<<s<<endl; return 0; } } } }
a.cc:3:10: fatal error: stdafx.h: No such file or directory 3 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.