Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <algorithm>
- #include <string>
- using namespace std;
- int main()
- {
- string str;
- int discount = 5;
- ifstream ifs("discount.in");
- getline(ifs, str);
- ifs.close();
- sort(str.begin(), str.end());
- str[0] += 32;
- for (int i = 1; i < str.size(); i++)
- {
- if (str[i] != str[i - 1])
- {
- discount += 5;
- }
- }
- ofstream ofs("discount.out");
- ofs << discount << '%' << endl << str << endl;
- ofs.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment