You are on page 1of 1

2.

#include <iostream>

#include <fstream>

using namespace std;

int main()

int n,a[100],i,j,aux;

ifstream f("date.in");

ofstream g("date.out");

f>>n;

for(i=1;i<=n;i++)

f>>a[i];

for(i=1;i<=n;i++)

aux=a[1];

for(j=2;j<=n;j++)

a[j-1]=a[j];

a[n]=aux;

for(j=1;j<=n;j++)

g<<a[j]<<" ";

g<<endl;

f.close();

g.close();

return 0;

You might also like