Task: | Osajono |
Sender: | KARHU |
Submission time: | 2015-10-05 18:14:45 +0300 |
Language: | C++ |
Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:12:5: error: 'string' is not a member of 'std' std::string syote; ^ input/code.cpp:14:14: error: 'syote' was not declared in this scope if(fgets(syote, sizeof(syote), stdin) != 0) ^
Code
#include <stdio.h>#include <stdlib.h>int summa(int i){return i > 0 ? i + summa(i - 1) : 0;}int main(){int i, j, k, tuloste = 0;std::string syote;if(fgets(syote, sizeof(syote), stdin) != 0){for(i = 'A'; i < 'Z'; i++){k = 0;for(j = 0; syote[j] != 0; j++)if(syote[j] == i || syote[j] == i + 32)k++;tuloste += summa(k);}}printf("%u\n", tuloste);return 0;}