2011. 9. 3. 14:47

//2011 07 02
//POJ 1298
//The Hardest Problem Ever


//1~200자의 문자를 받음 옆으로 5칸씩 -> 아스키코드 이용하여 출력
//int 배열로 받고, 끝나는거 확인하구 입력은... 아 끝나는게 문제구나

#include <iostream>
#include <string>
using namespace std;

int main()
{
 string strStart, strEnd;
 string strIn[100];
 int i = 0;
 getline(cin,strStart) ;

 while(strStart != "ENDOFINPUT")
 {
  getline(cin,strIn[i]);
  for(int a = 0 ; a < strIn[i].length()  ; a++)
  {
   if(strIn[i][a] >= 65 && strIn[i][a] <=90)
   {
    strIn[i][a] -= 5;
    if(strIn[i][a] < 65 && strIn[i][a] >=60)
     strIn[i][a] += 26;
   }
  }
  getline(cin,strEnd);
  i++;
  getline(cin,strStart) ;
 }


 for(int a= 0 ; a <i ; a++)
 {
  cout << strIn[a];
  cout << endl;
 }
 system("pause");
 return 0;
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1166  (0) 2011.09.03
[ALGORISM]poj 1218  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
Posted by I_co