|
|
back to boardWA - но почему?! Posted by deamont 26 Mar 2013 18:24 #include <iostream> int ClickCount(char c); using namespace std; int main() { char Buf[1001]; cin.getline(Buf,1001); int Result=0; int i=0; while (Buf[i]!='\0') { Result+=ClickCount(Buf[i]); i++; } cout << Result; //system("pause");
return 0; } int ClickCount(char c) { char AlphaBet[]="abcdefghijklmnopqrstuvwxyz*.,!# *"; for (int i=0;i<=sizeof AlphaBet;i++) { if (c==AlphaBet[i]) return i%3+1; } return 0; } |
|
|