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, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
As with any small island country, cuba has fewer natural resources than countries such as brazil. this affects their economy in that cuba a) exports only manufactured products. b) exports more products than it imports.. c) must import more products than it exports. d) has imposed trade barriers against the united states.
Answers: 3
question
Computers and Technology, 23.06.2019 13:00
Which one of the following voltages should never be measured directly with a vom? a. 1200 v b. 500 v c. 800 v d. 100v
Answers: 2
question
Computers and Technology, 24.06.2019 15:30
The idea that, for each pair of devices v and w, there’s a strict dichotomy between being “in range” or “out of range” is a simplified abstraction. more accurately, there’s a power decay function f (·) that specifies, for a pair of devices at distance δ, the signal strength f(δ) that they’ll be able to achieve on their wireless connection. (we’ll assume that f (δ) decreases with increasing δ.) we might want to build this into our notion of back-up sets as follows: among the k devices in the back-up set of v, there should be at least one that can be reached with very high signal strength, at least one other that can be reached with moderately high signal strength, and so forth. more concretely, we have values p1 ≥ p2 ≥ . . ≥ pk, so that if the back-up set for v consists of devices at distances d1≤d2≤≤dk,thenweshouldhavef(dj)≥pj foreachj. give an algorithm that determines whether it is possible to choose a back-up set for each device subject to this more detailed condition, still requiring that no device should appear in the back-up set of more than b other devices. again, the algorithm should output the back-up sets themselves, provided they can be found.\
Answers: 2
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
Mathematics, 03.12.2020 20:10
question
Mathematics, 03.12.2020 20:10
question
Mathematics, 03.12.2020 20:10
question
Health, 03.12.2020 20:10
question
Mathematics, 03.12.2020 20:10
question
History, 03.12.2020 20:10
question
Mathematics, 03.12.2020 20:10
question
Mathematics, 03.12.2020 20:10
question
Mathematics, 03.12.2020 20:10