您的答案為: ergoe s leznogyei necoobn iaxeqhss .chmt iaheans gs" e oirlnsotes luetrhn 正確答案為: ergoe s leznogyei necoobn iaxeqhss .chmt iaheans gs" e oirlnsotes luetrhn
我有錯的CODE如下
#include<bits/stdc++.h> using namespace std; string s[105]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int row=0, col=0; while(getline(cin, s[col])){ row=max(row , (int)s[col].size()); col++; } for(int i=0; i<row; i++){ for(int j=col-1; j>=0; j--){ if(i>= s[j].size()) cout<<" "; cout<<s[j][i]; } cout<<"\n"; } return 0; }
您的答案為: ergoe s leznogyei necoobn iaxeqhss .chmt iaheans gs" e oirlnsotes luetrhn 正確答案為: ergoe s leznogyei necoobn iaxeqhss .chmt iaheans gs" e oirlnsotes luetrhn
我有錯的CODE如下#include using namespace std; string s[105]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int row=0, col=0; while(getline(cin, s[col])){ row=max(row , (int)s[col].size()); col++; } for(int i=0; i=0; j--){ if(i>= s[j].size()) cout<<" "; cout<
【題解】ZeroJudge c045: 00490 – Rotating Sentences – Yui Huang 演算法學習筆記
參考的AC CODE
您的答案為: ergoe s leznogyei necoobn iaxeqhss .chmt iaheans gs" e oirlnsotes luetrhn 正確答案為: ergoe s leznogyei necoobn iaxeqhss .chmt iaheans gs" e oirlnsotes luetrhn
我有錯的CODE如下#include using namespace std; string s[105]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int row=0, col=0; while(getline(cin, s[col])){ row=max(row , (int)s[col].size()); col++; } for(int i=0; i=0; j--){ if(i>= s[j].size()) cout<<" "; cout<
【題解】ZeroJudge c045: 00490 – Rotating Sentences – Yui Huang 演算法學習筆記
參考的AC CODE
if(i>= s[j].size()) cout<<" "; cout<<s[j][i];
少了一個else