-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathchinese.cpp
More file actions
43 lines (41 loc) · 920 Bytes
/
chinese.cpp
File metadata and controls
43 lines (41 loc) · 920 Bytes
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
/*#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
#include <locale>
using namespace std;
int main(){
locale china("chs");
wcin.imbue(china);
wcout.imbue(china);
ifstream input("in.txt");
input.imbue(china);
wstring st;
wchar_t wd = L‘。’;
if(input.fail()){
cerr << "No in.txt" << endl;
exit(-1);
}
while(getline(input, st, wd)){
wcout << st << endl;
}
input.close();
return 0;
}
*/
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{
char c[10]="今天\0";
cout<<c<<endl;
for(int i=0;i<10;++i)
cout<<int(c[i])<<endl;
char ch[3]={-67,-15,0};
cout<<ch<<endl;
char ch1[200] = "今天是个好天气!";
cout << ch1 << endl;
for(int i = 0; i < 16; ++i)
cout << ch1[i] << ch1[i+1];
return 0;
}