Обсуждения
if i text 21 it stacks. program says you are a child. you are a teenager. you are adult. how can i delete this "stack".
#include <iostream>
using namespace std;
int main() {
int age;
cin>>age;
if (age>=14){
cout<<"You're a Teenager"<<endl;
}
if (age>=18){
cout<<"You're adult"<<endl;
}
if (age>=0){
cout<<"You're a Child"<<endl;
}
else{
cout<<"Are u stupid ?"<<endl;
}
return 0;
}
0 голосов
4 ответовHow can I read from a file this line
19 34 Gateway Arch - St. Louis, MO.
The first digit is age, second timeUsed, and the rest description. So I want to read them and store them in a variable.
The code insime my while loop of my File is int age = reader.nextInt();
Int Tused = reader.nextInt();
Description = reader.next()
0 голосов
4 ответовguys this code I wrote passed all the unittest specifications in an oop lab. but they told me that I failed a hidden test. that my code can still be improved upon. I've tried my best but I don't know how to improve the code again. please give me ideas. am I using WET in any block. any unnecessary repetitions or redundancy? this is the code below:
http://www.sololearn.com/app/python/playground/cG5UEvIEkuHd/
0 голосов
4 ответовАктуальное сегодня
Ejercicio Pytho
0 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
Please rate my code from 1 to 10
2 Votes
How to start
0 Votes