源程序: #include<iostream> using namespace std; int main() { char buf[10]; int i = 0; while (cin.getline(buf, 10)) //若输入流的一行超过9个字符,则会出错 cout << ++i << ": ...
分类:
其他好文 时间:
2020-01-27 15:50:57
阅读次数:
63
源程序: // // main.cpp // p292 // // Created by duanqibo on 2020/1/27. // Copyright © 2020年 duanqibo. All rights reserved. // #include<iostream> using na ...
分类:
其他好文 时间:
2020-01-27 15:49:07
阅读次数:
78
源程序: // // main.cpp // p285 // // Created by duanqibo on 2020/1/27. // Copyright © 2020年 duanqibo. All rights reserved. // //程序7-6 #include<iostream> ...
分类:
其他好文 时间:
2020-01-27 15:43:34
阅读次数:
82
源程序: // // main.cpp // p286 // // Created by duanqibo on 2020/1/27. // Copyright © 2020年 duanqibo. All rights reserved. // //程序7-7 #include <iostream> ...
分类:
其他好文 时间:
2020-01-27 15:40:40
阅读次数:
62
源程序: //程序7-9 #include <iostream> using namespace std; int main() { double values[] = { 1.23,20.3456,300.4567,4000.56789,50000.1234567 }; cout.fill('*' ...
分类:
其他好文 时间:
2020-01-27 15:39:09
阅读次数:
60
源程序: #include <iostream> #include <string> using namespace std; int main() { char ch; int sum = 0,count = 0,x; cout<<"请输入整数(按Ctrl+Z退出)"<<endl; do { wh ...
分类:
其他好文 时间:
2020-01-27 15:30:49
阅读次数:
64
源程序: //程序7-8 #include <iostream> #include <iomanip> using namespace std; int main() { double x = 12.34; cout << "1)" << setiosflags(ios::scientific | ...
分类:
其他好文 时间:
2020-01-27 15:18:48
阅读次数:
66
源程序: #include <iostream> using namespace std; int main() { int x, count, sum = 0; freopen("c:\\input.txt", "r", stdin); //将标准输入重定向到文件input.txt for (co ...
分类:
其他好文 时间:
2020-01-27 14:06:19
阅读次数:
70
源程序: #include <iostream> using namespace std; int main() { int x, count, sum = 0; freopen("c:\\input.txt", "r", stdin); for (count = 0; count<10; coun ...
分类:
其他好文 时间:
2020-01-27 14:00:25
阅读次数:
65
源程序: #include <iostream> using namespace std; int main() { int x, y; cin >> x >> y; freopen("c:\\test.txt", "w", stdout); if (y == 0) cerr<<"error."<< ...
分类:
其他好文 时间:
2020-01-27 13:56:23
阅读次数:
65