上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 54 下一页
摘要: 源程序: #include<iostream> using namespace std; int main() { char str[30]; while (!cin.eof()) //当输入流没有结束时继续循环 { cin.ignore(10, ':'); //在cin流中跳过':'之前的全部字符 阅读全文
posted @ 2020-01-27 15:16 bobo哥 阅读(130) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream> using namespace std; int main() { char buf[10]; int i = 0; while (cin.getline(buf, 10)) //若输入流的一行超过9个字符,则会出错 cout << ++i << ": 阅读全文
posted @ 2020-01-27 15:10 bobo哥 阅读(132) 评论(0) 推荐(0)
摘要: 源程序: // // main.cpp // p292 // // Created by duanqibo on 2020/1/27. // Copyright © 2020年 duanqibo. All rights reserved. // #include<iostream> using na 阅读全文
posted @ 2020-01-27 14:59 bobo哥 阅读(132) 评论(0) 推荐(0)
摘要: 源程序: //程序7-10 #include <iostream> using namespace std; int main() { char c = 'a', str[80] = "0123456789abcdefghijklmn"; int x = 65; cout << "cout.put( 阅读全文
posted @ 2020-01-27 14:45 bobo哥 阅读(136) 评论(0) 推荐(0)
摘要: 源程序: //程序7-9 #include <iostream> using namespace std; int main() { double values[] = { 1.23,20.3456,300.4567,4000.56789,50000.1234567 }; cout.fill('*' 阅读全文
posted @ 2020-01-27 14:42 bobo哥 阅读(152) 评论(0) 推荐(0)
摘要: 源程序: //程序7-8 #include <iostream> #include <iomanip> using namespace std; int main() { double x = 12.34; cout << "1)" << setiosflags(ios::scientific | 阅读全文
posted @ 2020-01-27 14:38 bobo哥 阅读(157) 评论(0) 推荐(0)
摘要: 源程序: // // main.cpp // p286 // // Created by duanqibo on 2020/1/27. // Copyright © 2020年 duanqibo. All rights reserved. // //程序7-7 #include <iostream> 阅读全文
posted @ 2020-01-27 14:34 bobo哥 阅读(221) 评论(0) 推荐(0)
摘要: 源程序: // // main.cpp // p285 // // Created by duanqibo on 2020/1/27. // Copyright © 2020年 duanqibo. All rights reserved. // //程序7-6 #include<iostream> 阅读全文
posted @ 2020-01-27 14:25 bobo哥 阅读(137) 评论(0) 推荐(0)
摘要: 源程序: #include<iostream> #include<iomanip> using namespace std; int main() { int n = 65535,m = 20; cout<<"1)"<<n<<"n"<<"="<<hex<<n<<"="<<oct<<n<<endl; 阅读全文
posted @ 2020-01-27 14:21 bobo哥 阅读(118) 评论(0) 推荐(0)
摘要: 源程序: #include <iostream> #include <string> using namespace std; int main() { char ch; int sum = 0,count = 0,x; cout<<"请输入整数(按Ctrl+Z退出)"<<endl; do { wh 阅读全文
posted @ 2020-01-27 14:15 bobo哥 阅读(112) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 54 下一页