Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
100667 周宸宇 加密的病历单 C++ Compile Error 0 MS 0 KB 821 2024-12-09 20:59:53

Tests(0/0):


Code:

#include<iostream> #include<cstring> using namespace std; int main(){ /* char a[1501],b[6]={'h','e','l','l','o'}; int d=0; cin>>a;{ if(a[j]==b[d]){ for(int j=0;a[j]!='\0';j++) d++; } } if(d==5){ cout<<"YES"; }else{ cout<<"NO"; } */ char a[50]; int b; cin>>a; b=strlen(a); for(int i=0;a[i]!='\0';i++){ if(a[i]>='A'&&a[i]<='Z'){ a[i]+=3; if(a[i]>'Z'){ a[i]-=26; } } a[i]+=32; else{ a[i]+=3; if(a[i]>'z'){ a[i]-=26; } } a[i]-=32; } } for(int i=b-1;i>=0;i--){ cout<<a[i]; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:33:9: error: 'else' without a previous 'if'
         else{
         ^
Main.cc: At global scope:
Main.cc:42:5: error: expected unqualified-id before 'for'
     for(int i=b-1;i>=0;i--){
     ^
Main.cc:42:19: error: 'i' does not name a type
     for(int i=b-1;i>=0;i--){
                   ^
Main.cc:42:24: error: 'i' does not name a type
     for(int i=b-1;i>=0;i--){
                        ^
Main.cc:45:5: error: expected unqualified-id before 'return'
     return 0;
     ^
Main.cc:46:1: error: expected declaration before '}' token
 }
 ^