Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- ifstream fin("medii.txt");
- int contor=0;
- int cifra(float x, int &y){
- y = ((int)x)%10;
- }
- int main()
- {
- int y;
- cifra(123.45, y);
- double a, b;
- while(fin >> a >> b)
- {
- int y1,y2;
- cifra(a,y1);
- cifra(b,y2);
- if (y1+1==y2) contor++;
- }
- cout << contor << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement