Advertisement
Luxeon94

18/19 Q1: The uprising mountain range; X34732

Nov 15th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.     char c1,c2,c3;
  6.     int count=0;
  7.     int lim;
  8.     cin >> lim;
  9.     while(lim!=0){
  10.         --lim;
  11.         cin >> c1 >> c2 >> c3;
  12.         if(c1=='/' and c2=='/' and c3=='/') ++count;
  13.         else if(c1=='-' and c2=='/' and c3=='/') ++count;
  14.         else if(c1=='-' and c2=='-' and c3=='/') ++count;
  15.     }
  16.     cout << count <<endl;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement