摘要: #include <iostream> using namespace std; float avg_score(float sc, int num) { return sc/num; } void show_score(float avg) { cout << "Your average scor 阅读全文
posted @ 2017-09-29 00:57 Bear_Guo 阅读(158) 评论(0) 推荐(0) 编辑
摘要: char ch; cin>>ch; 1, while ( cin.get(ch) ) 2,while( ch != EOF ) 3, while( cin.fall() == false ) 4, while( (ch = cin.get()) != EOF) 5, while( !cin ) 阅读全文
posted @ 2017-09-28 01:43 Bear_Guo 阅读(132) 评论(0) 推荐(0) 编辑
摘要: vector 类型直接初始化赋值会报错,但是array 可以直接初始化。 阅读全文
posted @ 2017-09-24 13:42 Bear_Guo 阅读(124) 评论(0) 推荐(0) 编辑
摘要: result: pr = 0x22fe10 , *pr = 75now pr = 0x22fe18 , *pr = 125access two element with array notationcount[0] = 5count[1] = 3access two element with poi 阅读全文
posted @ 2017-09-21 01:19 Bear_Guo 阅读(126) 评论(0) 推荐(0) 编辑
摘要: cin.getline( name, LEN )可以读取一行字符串,通过换行符确定已经读到行尾,但它不保存换行符。 cin.get( name, LEN )可以读取一行字符串,但会将换行符留在输入队列当中,后面程序出现cin读取输入时,cin会先读到换行符从而忽略过去。 所以,可以写成这样: cin 阅读全文
posted @ 2017-09-18 01:49 Bear_Guo 阅读(318) 评论(0) 推荐(0) 编辑
摘要: Enjoy being a programming Ape!Make me dive into the coding world.This is the first day of marking my note about new technology for recalling. The life 阅读全文
posted @ 2017-09-17 01:11 Bear_Guo 阅读(198) 评论(0) 推荐(0) 编辑