标签:getch cout std ret stream tchar str while hduoj
#include<iostream> #include<stdlib.h> using namespace std; int main() { while (1) { int count=0; int sum=0; while (1) { char c; int temp = 0; c = getchar(); if (c == ‘#‘) return 0; if (c == ‘\n‘) break; count++; if(c!=‘ ‘) temp = count*(c-‘A‘+1); sum += temp; } cout << sum << endl; } }
标签:getch cout std ret stream tchar str while hduoj
原文地址:https://www.cnblogs.com/DaiShuSs/p/9607567.html