Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- using namespace std;
- ifstream f("arc.in");
- ofstream g("arc.out");
- void cer1()
- {
- long n,aux,x,i,nrs=1;
- f>>n>>aux;
- for (i=1;i<n;i++)
- {
- f>>x;
- if (x!=aux)
- nrs++;
- aux=x;
- }
- g<<nrs;
- }
- void cer2 ()
- {
- }
- int main()
- {
- short p;
- f>>p;
- if (p==1)
- cer1();
- else
- cer2();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement