- 博客(4)
- 问答 (1)
- 收藏
- 关注
原创 Python获取本机IP方法
首先想到的肯定是利用socket来获取import socketprint(socket.gethostbyname(socket.gethostname()))但这个方法是依赖于你的hostname跟ip地址有良好的对应关系,也就是说你的socket.gethostname()获得的是/etc/hostname下的名字,socket.gethostbyname(host)这个函数呢是根据你的名...
2018-04-27 22:49:31 403
原创 整理下C++primer plus 第六版第六章习题。
#include #include#include#include#includeusing namespace std; //头文件为了偷懒,把所有题目有用到过的都写在一块了第一题int main() { char word; while (cin.get(word) && word != '@') {
2016-09-20 22:15:35 496
原创 while循环内输入和循环外输入有何区别?
int main(){ show(); char ch; cin >> ch; while (ch != 'q') { switch (ch) { case'a':count_name(); break; case'b':count_title(); break;
2016-09-09 16:29:51 1193 3
原创 C++ Prime Plus 学习有感
我的代码int main(){ double count = 0.0, average, sum = 0.0; array love; for (int i = 0; i { count = 0; while (!(cin >> love[i])) { cin.cl
2016-08-30 20:40:26 1182
空空如也
c++中this 为0x1c,自定义的类Vector<string>读取文件内容时报错
2017-01-12
TA创建的收藏夹 TA关注的收藏夹
TA关注的人