Skip to content
Snippets Groups Projects
Commit 33c41162 authored by Adrien Rougny's avatar Adrien Rougny
Browse files

Merge branch 'master' of https://gitlri.lri.fr/nthiery/wims-info

parents 5e88d7ca 3f605720
No related branches found
No related tags found
No related merge requests found
#include<iostream>
using namespace std;
void saisie(int a){
cout<<"Tapez un entier ";
cin>>a;
if((a%3==0) && (a/3==42)) cout<<"la saisie est bonne : " << a/3 <<endl;
else cout<<"la saisie est n'est pas bonne"<<endl;
}
int main()
{
int a;
saisie(a);
return 0;
}
#include<iostream>
using namespace std;
void saisie(int a){
while (a%3!=0){
cout<<"Tapez un entier ";
cin>>a;
}
while (a/4!=42){
cout<<"Tapez un entier ";
cin>>a;
}
cout<<"la saisie est bonne : " << a/4 <<endl;
}
int main()
{
int a;
saisie(a);
return 0;
}
\ No newline at end of file
#include<iostream>
using namespace std;
void saisie(int a){
cout<<"Tapez un entier ";
cin>>a ;
while (a/3!=42){
cout<<"Tapez un entier ";
cin>>a;
}
cout<<"la saisie est bonne : " << a/3 <<endl;
}
int main()
{
int a;
saisie(a);
return 0;
}
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