subject

Cerință Policarp e foarte bogat. Este atât de bogat încât tot ce știe despre averea lui este că valoarea ei e un număr format dintr-un 1 urmat de X de 0. Dându-se numărul natural X, să se afișeze valoarea averii lui Policarp.

Date de intrare
Se citește numărul X.

Date de ieșire
Se afișează valoarea averii lui Policarp.

Restricții
X este un număr natural mai mic decât 100.
Exemplu
Date de intrare Date de ieșire
4 10000

si eu am facut
#include
using namespace std;
int x, a = 1, ca;
int main() {
cin >> x;
if (x <= 9) {
while (x <= 9 && x != 0) {
a *= 10;
--x;
}
cout << a << endl;
} else if (x > 9) {
ca = 1000000000;
while (x != 9) {
--x;
ca =ca * 10;
}
cout << ca << endl;
} else if (x == 1)
cout << "10";
}

dar nu merge atunci cand pun 10 sau mai mult unde am gresit?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:20
When developing a stakeholder matrix, the portfolio manager must look at the portfolio governance in order to complete the stakeholder analysis. in your own words, what is the role, interest and expectations of the governance?
Answers: 3
question
Computers and Technology, 22.06.2019 11:40
Pthreads programming: create and terminate a thread write a c++ program that creates a thread. the main will display a message “hello world from the main”. the main will create a thread that will display a message “hello world from the thread” and then terminates with a call to pthread_exit()
Answers: 3
question
Computers and Technology, 25.06.2019 00:30
What is a typeface? a. a collection of similar text b. a collection of similar fonts c. a collection of similar designs d. a collection of similar colors e. a collection of similar images
Answers: 1
question
Computers and Technology, 25.06.2019 04:00
Use the wrap text icon to modify which graphic appears in the front of layered images modify the picture effects change the way text is wrapped around an object apply wordart to the text
Answers: 1
You know the right answer?
Cerință Policarp e foarte bogat. Este atât de bogat încât tot ce știe despre averea lui este că val...
Questions
question
Social Studies, 23.10.2020 18:20
question
History, 23.10.2020 18:20
question
Mathematics, 23.10.2020 18:20
question
Social Studies, 23.10.2020 18:20
question
Mathematics, 23.10.2020 18:20
question
Chemistry, 23.10.2020 18:20
Questions on the website: 13722367