Codeforces 344A - Magnets Mohamed Sobhi 9:17 ص A Problems , Codeforces Edit Codeforces 344A Magnets #include <iostream> using namespace std; int main() { int a,b=0,p; cin>>a; for(int i=0;i<a;i++){ int ne; cin>>ne; if(ne!=p &&i>0){ b++; } p=ne; } cout<<++b<<"\n"; return 0; } Share on Facebook Share on Twitter Share on Google Plus About Mohamed Sobhi My name is Mo.Sobhy ,I study at School excelling high school in Ain Shams ,Cairo My hobbies is programming ,and web development ,playing chess and writing horror stories. RELATED POSTS
0 التعليقات:
إرسال تعليق