攻城狮凌风

02 2014 档案

基于C++求两个数的最大公约数最小公倍数
摘要:求x,y最大公约数的函数如下: int gys(int x,int y){ int temp; while(x) {temp=x; x=y%x; y=temp;} return y; } x=y的时候一目了然下面就不考虑,仅针对x不等于y的情况... 阅读全文

posted @ 2014-02-20 15:12 攻城狮凌风 阅读(3408) 评论(0) 推荐(0)

C++中cin.get(),cin.getline(),cin>>,gets(),cin.clear()使用总结
摘要:1.cin.get() 实质:类istream所定义对象cin的重载成员函数 用于读取单字符 istream& get(char&) int get(void) 用于读取字符串 istream &get(char*,int) istream &get(char*,int,... 阅读全文

posted @ 2014-02-14 22:31 攻城狮凌风 阅读(454) 评论(0) 推荐(0)

导航