Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Header.h"
- #include "SLOVO.cpp"
- using namespace std;
- int Slovo::summa()
- {
- sum = 0;
- int n;
- n = slovo.length();
- for (int i = 0; i < n; i++){
- sum += (int)slovo[i];
- //cout <<"-";
- // cout << sum << endl;
- }
- // cout << sum ;
- return (sum);
- }
- int Slovo::zamena(){
- int m, k;
- m = slovo.length();
- k = str2.length();
- for (int i = 0; i < m; i++){
- for (int j = 0; j < m; j++){
- if (i != j)continue;
- slovo[i] = (int)slovo[i] - 32;
- str2[j] = (char)slovo[i];
- cout << str2[j];
- }
- }
- cout << endl;
- return 0;
- }
- void Slovo::set()
- {
- cout << "vvedite slovo: ";
- cin >> slovo;
- cout << "---------------------------------------------------" << endl;
- cout << endl;
- }
- void Slovo::show()
- {
- cout << "summa: " << summa() << endl << endl;
- cout << "slovo posle zameni: " << zamena() << "\n" << endl;
- }
- int main()
- {
- Slovo n1;
- n1.set();
- n1.show();
- }
Add Comment
Please, Sign In to add comment