Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#3c
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- ifstream fileInput("input.txt");
- if(fileInput.is_open() == 0){
- cout << "FILE NOT FOUND! CREATE IT BY YOURSELF";
- return 0;
- }
- int shag, pred, tek;
- fileInput >> pred >> tek;
- shag = tek - pred;
- pred = tek;
- while(fileInput >> tek){
- if(shag != tek - pred){
- cout << "Eto ne arithmetic progressiya >_<";
- return 0;
- }
- pred = tek;
- }
- cout << "Eto arithmetic progression ^_^";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment