---
# System prepended metadata

title: Rotating Sentences
tags: [UVA]

---

# Rotating Sentences
題目連結 [UVA 490](https://onlinejudge.org/external/4/490.pdf)

## 中文簡述
把所輸入的字串旋轉90度

## solution:
```
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string str[101];
	int smax=0,n=0,i,j;
	while(getline(cin,str[n]))
	{
		smax=smax>str[n].length()?smax:str[n].length();
		n++;
	}
//	cout<<smax<<endl;
	for(j=0;j<smax;j++,cout<<endl)
	{
		for(i=n-1;i>=0;i--)
		{
			if(str[i].length()>j)
			{
				cout<<str[i][j];
			}
			else
			{
				cout<<" ";
			}
		}
	}
	return 0;
	

	
}


```
###### tags: `UVA` 
回目錄 [學習筆記](/gIBZqAbWTCis7uOPp149gA)

