Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- string s;
- int vs[30], ms[30];
- int main()
- {
- ifstream fin;
- fin.open("ulaz.txt");
- ofstream fout;
- fout.open("izlaz.txt");
- long long a = 0;
- getline(fin, s);
- for (int i=0; i<26; i++)
- fin >> vs[i];
- for (int i=0; i<26; i++)
- fin >> ms[i];
- for (int i=0; i<s.length(); i++)
- if (s[i]==' ')
- a = a + 3;
- else if (s[i]>65 && s[i]<91)
- a = a + vs[s[i]-65];
- else if (s[i]>96 && s[i]<123)
- a = a + ms[s[i]-96];
- a = a + s.length() - 1;
- fout << a << endl;
- // system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement