C++ cin cout
//it_start and it_end are the start and end iterators of your container
//(ie. vec.begin() and vec.end())
//T is the type of your container (for example, for a std::vector<int> then
//T is int)
//separator is a string that will be inserted between each element
std::copy(it_start, it_end, std::ostream_iterator<T>(std::cout, separator));
4.3
10
std::cout << "Hello World!" << std::endl; //Or you can do
std::cout << "Hello World!" <<; //Only in some scenarios
Thank you!
10
0
4.38
8
//Akbarali saqlagan C++ bo'yicha cin operatoriga ta'rif
#include <iostream>
using namespace std;
int main (){
int a;
cout << "Kattaroq sonni yozing: ";
cin >> a;
int b;
cout << "Tepadaginga nisbatan kichik bo`lgan son(qiymatni) yozing: ";
cin >> b;
cout << "Birinchi kiritgan soningizdan ikkinchi kiitgan soningiz " << a-b << " marta katta ekanligi ma'lum bo'ldi.\n";
return 0;
}
Thank you!
8
0
4
10
cout << "Hello World!";
Thank you!
10
0
4.14
7
int age;
cout << "How old are you ?" << endl;
cin >> age;
Thank you!
7
0
Are there any code examples left?
New code examples in category C++