牛逼c++
rocvfx
Goals determine what you're going to be.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
my first C++ program
//myfirst.cpp --原创 2016-10-09 16:48:17 · 1136 阅读 · 0 评论 -
cpp 3.13
3.13#include int main(){ using namespace std; cout.setf(ios_base::fixed, ios_base::floatfield); float tree = 3; int guess(3.9832); int debt = 7.2E12; cout << "tree = " << tree << endl; cout原创 2016-10-21 13:17:20 · 440 阅读 · 0 评论 -
c++ prime plus 2.2
2.2#include int main(){ using namespace std; int carrots; carrots = 25; cout << "I have "; cout << carrots; cout << " carrots."; cout << endl; carrots = carrots - 1; cout << "Crunch, crun原创 2016-10-10 15:41:53 · 500 阅读 · 0 评论 -
c++ prime plus2.5
2.5#include void simon(int);int main(){ using namespace std; simon(3); cout << "Pick an integer: "; int count; cin >> count; simon(count); cout << "Done!" << endl; cin.get(); cin.get();原创 2016-10-11 11:45:48 · 557 阅读 · 0 评论 -
cpp 4.17
4.17#includeint main(){ using namespace std; int nights = 1001; int*pt = new int; *pt = 1001; cout << "nights value = "; cout << nights << ": location " << &nights << endl; cout << "int ";原创 2016-11-03 09:35:05 · 731 阅读 · 0 评论 -
c++ prime plus 3.1
3.1#include#includeint main(){ using namespace std; int n_int = INT_MAX; short n_short = SHRT_MAX; long n_long = LONG_MAX; long long n_llong = LLONG_MAX; cout << "int is " << sizeof (int)原创 2016-10-13 14:51:49 · 439 阅读 · 0 评论 -
cpp 4.19
4.19#includeint main(){ using namespace std; double wages[3] = {10000.0, 20000.0, 30000.0}; short stacks[3] = {3, 2, 1}; double*pw = wages; short*ps = &stacks[0]; cout << "pw = " << pw <<原创 2016-11-04 09:56:59 · 354 阅读 · 0 评论 -
cpp 4.1
4.1#includeint main(){ using namespace std; int yams[3]; yams[0] = 7; yams[1] = 8; yams[2] = 6; int yamcosts[3] = { 20, 30, 5 }; cout << "Total yams = "; cout << yams[0] + yams[1] + yams原创 2016-10-24 09:50:01 · 269 阅读 · 0 评论 -
c++ prime plus 3.2
3.2#include#define ZERO 0#includeint main(){ using namespace std; short sam = SHRT_MAX; unsigned short sue = sam; cout << "Sam has " << sam << "dollars and Sue has " << sue; cout << " doll原创 2016-10-14 09:42:47 · 517 阅读 · 0 评论 -
cpp 4.4
4.4#include#includeint main(){ using namespace std; const int ArSize = 20; char name[ArSize]; char dessert[ArSize]; cout << "Enter your name:\n"; cin.getline(name, ArSize); cout << "Enter原创 2016-10-25 12:01:55 · 302 阅读 · 0 评论 -
cpp 4.22
4.22#define _CRT_SECURE_NO_WARNINGS#include#includeusing namespace std;char * getname(void);int main(){ char * name; name = getname(); cout << name << " at " << (int *)name << "\n"; delete原创 2016-11-07 09:33:51 · 359 阅读 · 0 评论 -
cpp5.1
5.1#includeint main(){ using namespace std; int i; for (i = 0; i < 5; i++) cout << "C++ knows loops.\n"; cout << "C++ knows when to stop.\n"; system("pause"); return 0;}原创 2016-11-08 09:22:46 · 492 阅读 · 0 评论 -
cpp 3.5
#include int main(){ using namespace std; char ch; cout << "Enter a character: " << endl; cin >> ch; cout << "Hola! "; cout << "Thank you for the " << ch << " character." << endl; system("pa原创 2016-10-18 10:52:11 · 322 阅读 · 0 评论 -
cpp 5.7
5.7#includeint main(){ using namespace std; int a = 20; int b = 20; cout << "a = " << a << ": b = " << b << "\n"; cout << "a++ = " << a++ << ": ++b = " << ++b << "\n"; cout << "a = " << a <<原创 2016-11-09 08:39:11 · 357 阅读 · 0 评论 -
cpp 4.7
4.7#include#includeint main(){ using namespace std; char charr1[20]; char charr2[20] = "jaguar"; string str1; string str2 = "panther"; cout << "Enter a kind of feline: "; cin >> charr1;原创 2016-10-28 14:01:07 · 286 阅读 · 0 评论 -
cpp 3.8
3.8#include int main(){ using namespace std; cout.setf(ios_base::fixed, ios_base::floatfield); float tub = 10.0 / 3.0; double mint = 10.0 / 3.0; const float million = 1.0e6; cout << "tub =原创 2016-10-19 16:32:43 · 296 阅读 · 0 评论 -
cpp 5.13
5.13#includeconst int ArSize = 20;int main(){ using namespace std; char name[ArSize]; cout << "Your first name, please: "; cin >> name; cout << "Here is your name, verticalized and ASCIIized原创 2016-11-10 10:27:54 · 324 阅读 · 0 评论 -
cpp 3.10
3.10#include int main(){ using namespace std; float hats, heads; cout.setf(ios_base::fixed, ios_base::floatfield); cout << "Enter a number: "; cin >> hats; cout << "Enter another number: ";原创 2016-10-20 09:50:19 · 301 阅读 · 0 评论 -
cpp5.17
5.17#includeint main(){ using namespace std; char ch; int count = 0; cout << "Enter characters; enter # to quit:\n"; cin.get(ch); while (ch != '#') { cout << ch; ++count; cin.get(c原创 2016-11-11 09:42:21 · 610 阅读 · 0 评论 -
cpp4.10
4.10#include#include#includeint main(){ using namespace std; char charr[20]; string str; cout << "Length of string in charr before input: " << strlen(charr) << endl; cout << "Length原创 2016-10-31 09:53:46 · 214 阅读 · 0 评论 -
cpp 4.12
4.12#includestruct inflatable{ char name[20]; float volume; double price;};int main(){ using namespace std; inflatable bouquet = { "sunflowers", 0.20, 12.49 }; inflatable choi原创 2016-11-01 10:43:37 · 271 阅读 · 0 评论 -
cpp6.8
6.8#include#includeint main(){ using namespace std; cout << "Enter text for analysis, and type @" " to terminate input.\n"; char ch; int whitespace = 0; int digits = 0; int chars = 0; i原创 2016-11-16 11:44:41 · 439 阅读 · 0 评论 -
cpp6.1
6.1#includeint main(){ using std::cin; using std::cout; char ch; int spaces = 0; int total = 0; cin.get(ch); while (ch != '.') { if (ch == ' ') ++spaces; ++total; cin.get(ch); }原创 2016-11-14 09:26:11 · 359 阅读 · 0 评论 -
cpp6.12
6.12#includeconst int ArSize = 80;int main(){ using namespace std; char line[ArSize]; int spaces = 0; cout << "Enter a line of text:\n"; cin.get(line, ArSize); cout << "Complete line:\n" <原创 2016-11-17 09:33:51 · 426 阅读 · 0 评论 -
cpp 4.14
4.14#includeint main(){ using namespace std; int donuts = 6; double cups = 4.5; cout << "donuts value = " << donuts; cout << " and donuts address = " << &donuts << endl; cout << "cups value原创 2016-11-02 09:50:14 · 536 阅读 · 0 评论 -
cpp 7.14
7.14#include#includeusing namespace std;const int SIZE = 5;void display(const string sa[], int n);int main(){ string list[SIZE]; cout << "Enter your " << SIZE << " favorite astronomical sigh原创 2016-11-30 12:55:34 · 286 阅读 · 0 评论 -
cpp 7.1
7.1#includevoid simple();int main(){ using namespace std; cout << "main() will call the simple() function:\n"; simple(); cout << "main() is finished with the simple() function.\n"; system(原创 2016-11-18 12:13:39 · 284 阅读 · 0 评论 -
cpp6.4
6.4#includeint main(){ using namespace std; cout << "This program may reformat your hard disk\n" "and destroy all your data.\n" "Do you wish to continue?"; char ch; cin >> ch; if (ch == '原创 2016-11-15 10:02:41 · 371 阅读 · 0 评论 -
cpp7.3
7.3#includeusing namespace std;void n_chars(char, int);int main(){ int times; char ch; cout << "Enter a character: "; cin >> ch; while (ch != 'q') { cout << "Enter an integer: "; cin原创 2016-11-21 11:26:32 · 331 阅读 · 0 评论 -
cpp 8.11
8.11#includetemplate void Swap(T &a, T &b);int main(){ using namespace std; int i = 10; int j = 20; cout << "i, j = " << i << ", " << j << ".\n"; cout << "Using complier-generated int swap原创 2016-12-12 10:37:51 · 285 阅读 · 0 评论 -
cpp7.6
7.6#includeconst int ArSize = 8;int sum_arr(int arr[], int n);int main(){ int cookies[ArSize] = { 1,2,4,8,16,32,64,128 }; std::cout << cookies << " = array address, "; std::cout << sizeof c原创 2016-11-22 10:33:20 · 366 阅读 · 0 评论 -
cpp 7.7
7.7#includeconst int ArSize = 8;int sum_arr(const int*begin, const int*end);int main(){ using namespace std; int cookies[ArSize] = { 1,2,4,8,16,32,64,128 }; int sum = sum_arr(cookies, cookie原创 2016-11-23 10:54:08 · 491 阅读 · 0 评论 -
cpp 8.1
8.1#includeinline double square(double x) { return x*x; }int main(){ using namespace std; double a, b; double c = 13.0; a = square(5.0); b = square(4.5 + 7.5); cout << "a = " << a << ",原创 2016-12-05 16:56:50 · 383 阅读 · 0 评论 -
cpp 8.3
8.3#includeint main(){ using namespace std; int rats = 101; int & rodents = rats; cout << "rats = " << rats; cout << ", rodents = " << rodents << endl; cout << "rats address = " << &rats;原创 2016-12-06 15:21:04 · 433 阅读 · 0 评论 -
cpp 8.14
8.14#includetemplate void ShowArray(T arr[], int n);templatevoid ShowArray(T *arr[], int n);struct debts{ char name[50]; double amount;};int main(){ using namespace std; int things原创 2016-12-13 13:01:47 · 336 阅读 · 0 评论 -
cpp 8.5
8.5#includedouble cube(double a);double refcube(double &ra);int main(){ using namespace std; double x = 3.0; cout << cube(x); cout << " = cube of " << x << endl; cout << refcube(x); cout原创 2016-12-07 09:54:29 · 317 阅读 · 0 评论 -
16进制练习
16进制转换练习#includeint main(){ using namespace std; int a; for (int i=0 ; i <= 10; i++) { cout << "Please enter a number: " << endl; cin >> a; cout << "The Hex of " << a << " is " << he原创 2016-12-07 17:26:42 · 445 阅读 · 0 评论 -
cpp 7.9
7.9#includeunsigned int c_in_str(const char*str, char ch);int main(){ using namespace std; char mmm[15] = "minimum"; char*wail = "ululate"; unsigned int ms = c_in_str(mmm, 'm'); unsigned in原创 2016-11-25 10:48:36 · 479 阅读 · 0 评论 -
cpp 8.7
8.7#include#includeusing namespace std;string version1(const string & s1, const string & s2);const string & version2(string & s1, const string & s2);const string & version3(string & s1, const原创 2016-12-08 10:32:10 · 344 阅读 · 0 评论 -
cpp 8.9
8.9#includeconst int ArSize = 80;char *left(const char * str, int n = 1);int main(){ using namespace std; char sample[ArSize]; cout << "Enter a string:\n"; cin.get(sample, ArSize); char*ps原创 2016-12-09 10:37:29 · 333 阅读 · 0 评论
分享