Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

water!!!

Posted by lrj124 at 2016-09-12 14:04:11 on Problem 1298
#include <iostream>
#include <cstdlib>
#include <string>
#include <map>
using namespace std;
int main() {
  string str;
  map <char,char> ks;
  ks['A'] = 'V';ks['B'] = 'W';ks['C'] = 'X';ks['D'] = 'Y';ks['E'] = 'Z';ks['F'] = 'A';ks['G'] = 'B';ks['H'] = 'C'; ks['I'] = 'D';ks['J'] = 'E';ks['K'] = 'F';ks['L'] = 'G';ks['M'] = 'H';ks['N'] = 'I';ks['O'] = 'J';ks['P'] = 'K';ks['Q'] = 'L';ks['R'] = 'M';ks['S'] = 'N';ks['T'] = 'O';ks['U'] = 'P';ks['V'] = 'Q';ks['W'] = 'R';ks['X'] = 'S';ks['Y'] = 'T';ks['Z'] = 'U';
  while (getline(cin,str),str != "ENDOFINPUT") {
    if (str == "START" || str == "END") continue;
	for (int i = 0;i < (int)str.length();i++)
	  if (str[i] >= 'A' && str[i] <= 'Z') cout << ks[str[i]];
	  else if (str[i] >= 'a' && str[i] <= 'z') cout << ks[str[i]-32]+32;
	  else cout << str[i];
	cout << '\n';
  }
  return EXIT_SUCCESS;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator