Initial commit
This commit is contained in:
33
cpp/Основы/вывод.cpp
Normal file
33
cpp/Основы/вывод.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#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;
|
||||
}
|
||||
Reference in New Issue
Block a user