Skip to content
Snippets Groups Projects
Commit e236fec0 authored by Nicolas M. Thiéry's avatar Nicolas M. Thiéry
Browse files

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

parents 9e059814 0a785413
Branches
No related tags found
No related merge requests found
Showing
with 76 additions and 119 deletions
#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;
}
\ No newline at end of file
#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
//============================================================================
// Name : testCpp.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
......@@ -19,5 +12,3 @@ int main() {
decrement(a);
cout << a << endl;
}
#include <iostream>
#include<iostream>
using namespace std;
int f(int n) {
return n*n;
void saisie(int a) {
int b;
cin >> b;
a = a + b;
cout << a;
}
int main() {
int a = 5;
a - 2;
cout << f(a) << endl;
saisie(a);
return 0;
}
//============================================================================
// Name : testCpp.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
......
#include<iostream>
using namespace std;
void saisie(int &a){
int b;
cin >> b;
a = a + b;
}
int main() {
int a = 5;
saisie(a);
cout << a;
return 0;
}
//============================================================================
// Name :
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
......
//============================================================================
// Name :
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
......
File deleted
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ofstream fichier("essai.txt");
fichier << 10 << 24 << endl;
fichier.close();
ifstream fichier2("essai.txt");
int i;
fichier2 >> i;
fichier2.close();
cout << i << endl;
return 0;
}
File deleted
#include <iostream>
#include <sstream>
using namespace std;
int main() {
istringstream a("12 1 4 5");
int j, k, i;
a >> j >> k >> i;
cout << i << endl;
return 0;
}
File deleted
#include <iostream>
#include <sstream>
using namespace std;
int main() {
istringstream flux("12 14.5 13 4");
int j, k, i;
string s;
flux >> j >> k >> s >> i;
cout << k << " " << s << " " << i << endl;
return 0;
}
File deleted
#include <iostream>
#include <sstream>
using namespace std;
int main() {
istringstream a("a bc de f");
string s, s1, s2;
a >> s >> s1 >> s2;
cout << s2 << endl;
return 0;
}
File deleted
#include <iostream>
#include <sstream>
using namespace std;
int main() {
ostringstream flux;
flux << "8+1=" << 8+1;
string s = flux.str();
cout << s.length() << endl;
return 0;
}
File deleted
#include <iostream>
#include <sstream>
using namespace std;
int main() {
istringstream flux("bonjour");
float j;
flux >> j;
if ( flux ) {
cout << "A" << endl;
} else {
cout << "B" << endl;
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment