21. februar 2006 - 23:00Der er
37 kommentarer og 1 løsning
Den bedste Guide! Og nogle Vinduer
Jeg er total nybegynder af Dev-C++. De eneste jeg kan lave er at den skriver hejsa :)Tænkte på om der nogle der ville give mig nogle færdige vinduer. Og en Guide hvad i gør.
cout << "I am thinking of a number between 1 and 10" << endl; cout << "Enter your guess, please " << endl; cin >> guess; if (guess == number) { cout << "Incredible, you are correct" << endl; }
cout << "I am thinking of a number between 1 and 10" << endl; cout << "Enter your guess, please "; cin >> guess; if (guess == number) { cout << "Incredible, you are correct" << endl; } else { cout << "Sorry, try again" << endl; }
cout << "I am thinking of a number between 1 and 10" << endl; cout << "Enter your guess, please "; cin >> guess; if (guess == number) { cout << "Incredible, you are correct" << endl; } else { cout << "Sorry, try again" << endl;
Så man ikke skal gå ud og ind for at prøve igen. Efter det her svar skal jeg ikke plage dig mere :=)
int number = 5; int guess; do { cout << "I am thinking of a number between 1 and 10" << endl; cout << "Enter your guess, please "; cin >> guess; if (guess == number) { cout << "Incredible, you are correct" << endl; } else { cout << "Sorry, try again" << endl; } cout << "Would you like to try again: "; cin.ignore(10124, '\n'); } while(cin.get() == 'j');
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.