Skip to content
Snippets Groups Projects
Commit 915367d9 authored by Slim Medimegh's avatar Slim Medimegh
Browse files

procedure_saisie_entrainement

parent 0a5ba33c
No related branches found
No related tags found
No related merge requests found
#include<iostream>
using namespace std;
void saisie(int *a, int* b, int N){
int i,j, t, o;
int c[2*N];
for(i=0;i<N;i++){cout<<"Tapez un entier ";cin>>a[i];}
for(i=0;i<N;i++){cout<<"Tapez un entier ";cin>>b[i];}
o=true;
i=0;
while(o && i<N-1)if(a[i]>a[i+1])o=false; else i++;
if(!o)cout<<"Erreur"<<endl;
o=true;
i=0;
while(o && i<N-1)if(b[i]>b[i+1])o=false; else i++;
if(!o)cout<<"Erreur"<<endl;
for(i=0;i<2*N;i++){
if(i<N)c[i]=a[i];
else c[i]=b[i-N];
}
for(i=0;i<2*N;i++)cout<<c[i]<<" ";
cout<<endl;
}
int main()
{
const int N=4;
int a[N];
int b[N];
saisie(a,b,N);
return 0;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment