Files
learning/cpp/Основы/вывод.cpp
2022-05-06 00:49:26 +03:00

34 lines
1.2 KiB
C++
Executable File

#include <iostream>
using namespace std;
int main(){
/* Вывод
Синтаксис: устройство << данные
cout - console out - консоль как устройство вывода
<< - оператор вывода. При использовании этого синтаксиса способен конкатенировать строки.
endl - '\n'
*/
cout << "Ever heard of rubber duck debugging?" << endl;
cout << " __ " << endl;
cout << " <(o )___-" << endl;
cout << " ( .__> /" << endl;
cout << " `----' " << endl;
printf("printf output: \n"); // Вывод в стиле C
char t;
t = 'f';
printf("printf output char: %c\n", t);
/*
%[flags][width][.precision][length]specifier
c - character, s - string, d/i - integer,
o - unsigned integer (octal), x/X - unsigned integer (hexadecimal),
u - unsigned integer (decimal), f/F - float (decimal),
e/E - float (exponential), a/A - float (hexadecimal exponent),
g/G - float (decimal/decimal exponential?),
n - number of chars written by far using this call function,
p - a pointer that points to the implementation-defined character sequence
*/
return 0;
}