Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- readf("%s", &studentCount);
- import std.stdio;
- void main()
- {
- write("How many students are there? ");
- /*
- * Определение переменной, которая будет использоваться для
- * хранения информации, которая считывается со входа.
- */
- int studentCount;
- // Сохранение входных данных для данной переменной
- readf("%s", &studentCount);
- writeln("Got it: There are ", studentCount, " students.");
- }
- import std.stdio;
- void main()
- {
- write("How many students are there? ");
- int studentCount;
- readf("%s", &studentCount);
- write("How many teachers are there? ");
- int teacherCount;
- readf("%s", &teacherCount);
- writeln("Got it: There are ", studentCount, " students",
- " and ", teacherCount, " teachers.");
- }
- // ...
- readf(" %s", &studentCount);
- // ...
- readf(" %s", &teacherCount);
- // ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement