1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
|
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
int main()
{
string s1;
int Zahl;
cout << "Geben Sie eine Zahl zwischen 1 bis 100 an! ";
cin >> s1;
Zahl = atoi(s1.c_str());
if(Zahl >= 1 && Zahl <= 100)
cout << setprecision(2) << fixed << setw(6) << right << s1 << endl;
else if(Zahl < 1)
cout << " Die angegebene Zahl ist zu klein!" << endl;
else
cout << " Die angegebene Zahl ist zu gross!" << endl;
system("PAUSE");
return 0;
} |