-
Notifications
You must be signed in to change notification settings - Fork 127
descrizione interessante #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,3 +47,4 @@ | |
| # | ||
| # return 0; | ||
| # } | ||
| week = input("Enter week number: ") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,37 +7,47 @@ | |
| # { | ||
| # string textInput; | ||
| # | ||
| # cout << "Enter a famous name+surname, ex. BarackObama " << endl; | ||
| # cout << "Enter a famous name+surname, ex. BarackObama ") | ||
| # cin >> textInput; | ||
| # | ||
| # if (textInput == "BarackObama") | ||
| # { | ||
| # cout << "44th president of the United States" << endl; | ||
| # } | ||
| # else if (textInput == "SandroPertini") | ||
| # { | ||
| # cout << "Former President of the Italian Republic" << endl; | ||
| # } | ||
| # else if (textInput == "NelsonMandela") | ||
| # { | ||
| # cout << "Former President of South Africa" << endl; | ||
| # } | ||
| # else if (textInput == "MahatmaGandhi") | ||
| # { | ||
| # cout << "Bapu" << endl; | ||
| # } | ||
| # else if (textInput == "DonaldKnuth") | ||
| # { | ||
| # cout << "Creator of LaTeX" << endl; | ||
| # } | ||
| # else if (textInput == "DennisRitchie") | ||
| # { | ||
| # cout << "Creator of C" << endl; | ||
| # } | ||
| # else | ||
| # { | ||
| # cout << "Invalid input! Please enter a good name!" << endl; | ||
| # } | ||
| # | ||
| # # print(44th president of the United States") | ||
| # # if (textInput == "SandroPertini") | ||
| # # print(Former President of the Italian Republic") | ||
| # # if (textInput == "NelsonMandela") | ||
| # # print(Former President of South Africa") | ||
| # # if (textInput == "MahatmaGandhi") | ||
| # # print(Bapu") | ||
| # # if (textInput == "DonaldKnuth") | ||
| # # print(Creator of LaTeX") | ||
| # # if (textInput == "DennisRitchie") | ||
| # # print(Creator of C") | ||
| # # else | ||
| # # print(Invalid input! Please enter a good name!") | ||
| # # | ||
| # return 0; | ||
| # } | ||
|
|
||
| good = False | ||
| textInput = input("Enter a famous name+surname, ex. BarackObama ") | ||
| if textInput == "BarackObama": | ||
| print("44th president of the United States") | ||
| good = True | ||
| if textInput == "SandroPertini": | ||
| print("Former President of the Italian Republic") | ||
| good = True | ||
| if textInput == "NelsonMandela": | ||
| print("Former President of South Africa") | ||
| good = True | ||
| if textInput == "MahatmaGandhi": | ||
| print("Bapu") | ||
| good = True | ||
| if textInput == "DonaldKnuth": | ||
| print("Creator of LaTeX") | ||
| good = True | ||
| if textInput == "DennisRitchie": | ||
| print("Creator of C") | ||
| good = True | ||
|
|
||
| if good == False: | ||
| print("Invalid input! Please enter a good name!") | ||
|
Comment on lines
+31
to
+53
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Invece che usare una variabile ausiliaria potresti semplicemente concatenare degli
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. si, in effetti non ci ho pensato |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cosa succede se l'utente inserisce 7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah si, devo togliere l'uguale in "week_input<=7" sennò accedo a memoria all'esterno dell'array