Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // qq.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <fstream>
- using namespace std;
- int main()
- {
- setlocale(LC_ALL, "rus");
- string str = "";
- string str1,str2,str3 = "";
- int a,b,c;
- int k = 0;
- ifstream input("123.txt");
- while(getline(input,str))
- {
- if(str[0] == 'О')
- {
- str1 = str[str.length() - 1];
- str2 = str[str.length() - 2];
- str3 = str[str.length() - 3];
- int a = atoi(str1.c_str());
- int b = atoi(str2.c_str());
- int c = atoi(str3.c_str());
- int d = c*100 + b*10 + a;
- if (d > 254) {
- cout << d << endl;
- k++;
- }
- }
- }
- cout << k << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement