вон. Noir уже написал рабочий код ) #include "stdafx.h" только добавить осталось и всесупер...а терь можешь код скопированный, если не в лом, скинуть))
Хочу выучить C++
Started by New Server!!!, Oct 29 2007 17:45
65 replies to this topic
#61
Posted 30 October 2007 - 20:52
#62
Posted 30 October 2007 - 20:55
$ ./a.out
Hello there
Here is 5: 5
The manipulator endl writes a new line to the screen
Here is a very big number: 70000
Here is the sum of 8 and 5: 13
Here's a fraction: 0.625
And a very very big number: 4.9e+07
Don't forget to replace Jesse Liberty with your name...
Jesse Liberty is a C++ programmer!
Это ми мимоходом вместе с вами учиццо
Hello there
Here is 5: 5
The manipulator endl writes a new line to the screen
Here is a very big number: 70000
Here is the sum of 8 and 5: 13
Here's a fraction: 0.625
And a very very big number: 4.9e+07
Don't forget to replace Jesse Liberty with your name...
Jesse Liberty is a C++ programmer!
#include <iostream> int main() { std::cout << "Hello there \n"; std::cout << "Here is 5: " << 5 << "\n"; std::cout << "The manipulator endl writes a new line to the screen" << "\n"; std::cout << "Here is a very big number:\t" << 70000 << "\n"; std::cout << "Here is the sum of 8 and 5:\t" << 8+5 << "\n"; std::cout << "Here's a fraction: \t" << (float) 5/8 << "\n"; std::cout << "And a very very big number:" << "\t"; std::cout << (double) 7000*7000 << "\n"; std::cout << "Don't forget to replace Jesse Liberty with your name..." << "\n"; std::cout << "Jesse Liberty is a C++ programmer!" << "\n"; return 0; }
Это ми мимоходом вместе с вами учиццо
#63
Posted 30 October 2007 - 21:22
От себя добавлю чисто так, как удобнее писать:
#include <iostream> using namespace std; // Стандартное пространство имён, можно не писать std:: int main() { cout << "Hello there \n"; cout << "Here is 5: " << 5 << "\n"; cout << "The manipulator endl writes a new line to the screen" << "\n"; cout << "Here is a very big number:\t" << 70000 << "\n"; cout << "Here is the sum of 8 and 5:\t" << 8+5 << "\n"; cout << "Here's a fraction: \t" << (float) 5/8 << "\n"; cout << "And a very very big number:" << "\t"; cout << (double) 7000*7000 << "\n"; cout << "Don't forget to replace Jesse Liberty with your name..." << "\n"; cout << "Jesse Liberty is a C++ programmer!" << "\n"; return 0; }
System #1: Debian GNU/Linux Squeeze/Sid + kernel 2.6.31.4 + gcc 4.3 + X.org 7.3 + KDE 3.5.9
System #2: Windows 7 x86 Ultimate
Сказал думер: IDCLIP... и застрял в стене
Я в контакте
System #2: Windows 7 x86 Ultimate
Сказал думер: IDCLIP... и застрял в стене
Я в контакте
#64
Posted 30 October 2007 - 21:25
От себя добавлю чисто так, как удобнее писать:
#include <iostream> using namespace std; // Стандартное пространство имён, можно не писать std:: int main() { cout << "Hello there \n"; cout << "Here is 5: " << 5 << "\n"; cout << "The manipulator endl writes a new line to the screen" << "\n"; cout << "Here is a very big number:\t" << 70000 << "\n"; cout << "Here is the sum of 8 and 5:\t" << 8+5 << "\n"; cout << "Here's a fraction: \t" << (float) 5/8 << "\n"; cout << "And a very very big number:" << "\t"; cout << (double) 7000*7000 << "\n"; cout << "Don't forget to replace Jesse Liberty with your name..." << "\n"; cout << "Jesse Liberty is a C++ programmer!" << "\n"; return 0; }
std:: добавил сам Компилятор. Я писал так же все, просто cout
#65
Posted 30 October 2007 - 21:46
using namespace ...; - плохой стиль. сам подумай, зачем разработчикам придумывать эти пространста имен и std в частности, если они теряют свой смысл из-за такой простой конструкции - using namespace ) она - для ленивых )
#66
Posted 30 October 2007 - 23:58
#include <mozg.h>
I'm from Vault 13... I must save it...
---=============---
---=============---
Найух этот вов.
---=============---
---=============---
Найух этот вов.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users