-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path6.cpp
120 lines (110 loc) · 2.55 KB
/
6.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/*************************************************************************
> File Name: 6.cpp
> Author:
> Mail:
> Created Time: 2017年03月08日 星期三 12时38分33秒
************************************************************************/
#include<iostream>
#include<cctype>
#include<fstream>
#include<cstring>
using namespace std;
int main()
{
//char ch;
//int ct1,ct2{0};
//
//while ((ch=cin.get())!='$'){
// cout<<ch;
// ct1++;
// if (ch='$'){
// ct2++;
// }
// cout<<ch;
//}
//cout<<"ct1="<<ct1<<",ct2="<<ct2<<"\n";
//string str1="Hello Word";
//int len=str1.length();
//char *str2=new char[len+1];
//str1.copy(str2,len,0);
//cout<<"length: "<<len<<endl;
//cout<<"Str2 "<<str2<<endl;
//string *str3=new string;
//*str3=str2;
//cout<<"str3:"<<*str3;
//delete str3;
//delete [] str2;
//ofstream file_out;
//file_out.open("out.md");
//if (file_out.is_open()){
// cout<<"open file success."<<endl;
//}else{
// cout<<"open fail!"<<endl;
// exit(EXIT_FAILURE);
//}
//6.10
//4
//int weight=3;
//cout<<weight<<","<<!!weight<<endl;
//6
//int x;
//cin>>x;
//x=x>=0?x:-x;
//cout<<x;
//7
//switch(ch){
// case 'A':a_grade++;
// break;
// case 'B':b_grade++;
// break;
// case 'C':c_grade++;
// break;
// case 'D':d_grade++;
// break;
// default:
// f_grade++;
//}
//9
//int line=0;
//char ch;
//while ((ch=cin.get())!='Q'){
// if (ch=='\n')
// line++;
//}
//cout<<line<<endl;
//6.11
//char ch;
//while ((ch=cin.get())!='@'){
// if (isdigit(ch))
// continue;
// //else if (islower(ch)){
// // cout<<(char)toupper(ch);
// //}else if (isupper(ch)){
// // cout<<(char)tolower(ch);
// //}else{
// // cout<<ch;
// //}
// else if(isalpha(ch)){
// cout<<(char)(islower(ch)?toupper(ch):ch);
// }
//}
//2
//int sum=0,count=0,donation=0;
//int i=0;
//double d_array[10]{0};
//while (isdigit(d_array[i]) && i<10){
// cin>>d_array[i];
// sum+=d_array[i];
// i++;
//}
//cout<<"sum:"<<sum;
//test
char one ,two;
cout <<"enter the two number(q to quit):";
while (cin >>one>>two ){
cout<<"one :"<<one<<'\n';
cout<<"two :"<<two<<'\n';
}
cout<<"Done!";
return 0;
}