关于记事本和unicode
  • 板块灌水区
  • 楼主eigw22h619
  • 当前回复5
  • 已保存回复5
  • 发布时间2022/5/25 16:40
  • 上次更新2023/10/28 00:39:14
查看原帖
关于记事本和unicode
295864
eigw22h619楼主2022/5/25 16:40

有如下程序:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	freopen("testing.out","w",stdout);
	const int ed=(9<<4)+9;
	for(int i=0;i<=ed;i+=3)
	if(i>>4>9||i>>4==0||(i&15)>9||(i&15)==0)printf("0,");
	else printf("%d,",((i>>4)-1)/3*3+((i&15)-1)/3+1);
	return 0;
}

期望的运行结果:

0,0,0,0,0,0,1,2,3,0,0,1,2,3,0,0,0,1,2,3,0,0,4,5,6,0,0,4,5,6,0,0,0,4,5,6,0,0,7,8,9,0,0,7,8,9,0,0,0,7,8,9,

实际结果: 用Dev-C++ IDE打开看了看,是对的,ASCII也是对的,但是用记事本打开就会变成格拉哥里字母。请问这是为何?

2022/5/25 16:40
加载中...