D
D
danielsolosyatov2014-01-10 20:12:49
C++ / C#
danielsolosyatov, 2014-01-10 20:12:49

Reading from keyboard up to space into C++ variable?

Two numbers are entered from the keyboard, separated by a space: 324 5676. There are two variables in the program, for example: int a, int b. You need to write the first number (before the space) into the variable a, the second number (before the space) into the variable b. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Prikhodko, 2014-01-10
@danielsolosyatov

Well, it's kind of simple:

int a,b;
cin>>a>>b;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question