This post has been edited 1 times, last edit by "Christian" (Aug 30th 2004, 8:34pm)
This post has been edited 2 times, last edit by "-=)GWC(RaMsEs" (Aug 30th 2004, 8:51pm)
Quoted
#include (iostream) // ( ) natürlich ersetzen
#include (cstdlib)
int main()
{
char a[20], b[20], c[20];
int w, x, y, z;
std::cout << "Geben Sie die 1. Zahl ein!";
std::cin >> a;
x = atoi(a);
std::cout << "Geben Sie die 2. Zahl ein!";
std::cin >> b;
y = atoi(b);
std::cout << "Geben Sie die 3. Zahl ein!";
std::cin >> c;
z = atoi(c);
w = x + y + z;
std::cout << w << std::endl;
return 0;
}
Quoted
#include (iostream) // ersetzen...
int main()
{
char a[20], b[20], c[20];
int w, x, y, z;
std::cout << "Geben Sie die 1. Zahl ein!";
std::cin.get(a, 20);
std::cin.clear();
std::cin.ignore( 1024, '\n' );
x = atoi(a);
std::cout << "Geben Sie die 2. Zahl ein!";
std::cin.get(b, 20);
std::cin.clear();
std::cin.ignore( 1024, '\n' );
y = atoi(b);
std::cout << "Geben Sie die 3. Zahl ein!";
std::cin.get(c, 20);
std::cin.clear();
std::cin.ignore( 1024, '\n' );
z = atoi(c);
w = x + y + z;
std::cout << w << std::endl;
return 0;
}