今天是練習cpe的Rotating Sentences題目
##程式碼
#include <iostream>
#include<string>
using namespace std;
string str[100];
int main()
{
int c=0;
int r=0;
while(getline(cin , str[c]))
{
r=max(r, (int)str[c].length());
c++;
}
for(int i=0 ; i < r ; i++)
{
for(int j=c-1 ; j >= 0 ; j--)
{
if(i >= str[j].length())
{
cout <<" ";
}
else
{
cout << str[j][i];
}
}
cout << endl;
}
return 0;
}
##解題方向