Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main()
- {
- string a,b;
- ifstream plik;
- plik.open("C:\\Users\\R_informatyka\\Desktop\\Dane1.txt");
- int wynik=0;
- for(int i=0;i<500;i++)
- {
- plik>>a;
- if (a.length()==2)
- {
- if(a[1]>=a[0]) wynik=wynik+1;
- }
- if (a.length()==3)
- {
- if(a[2]>=a[1]>=a[0]) wynik=wynik+1;
- }
- if (a.length()==4)
- {
- if(a[3]>=a[2]>=a[1]>=a[0]) wynik=wynik+1;
- }
- }
- cout<<wynik;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement