-
-
莫名其妙的notepad
-
发表于:
2010-12-1 19:15
4233
-
7.txt
今天朋友给了一段程序,写入一个7.txt文件。明明就是0, 1, 2加空格,但是用notepad打开就是显示怪怪的东西,好奇怪。用ultraeditor打开正常显示啊。
‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‱‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‱‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰′‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‱‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‱‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‱‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰′‰‰‰‱‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‱‰‱‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‱‰‰‰‰‰‰‰‱‰‰‰′‰‰‰‰‰‰‰‰‰‰‰‰‰‱‰‰‰‰‰‰
这段代码:
#include <iostream>
#include <cstdio>
using namespace std;
int arr[1000000];
//typedef long long __int64 ;
void test(__int64 c)
{
if(c % 2) // 周长必须是偶数
return;
for(int m=2; m*m<=c/2; ++m)
{
for(int n=1; n<m; ++n)
if(m*(m+n) == c/2)
arr[c]++;
}
}
int main()
{
freopen("7.txt", "w", stdout);
for(__int64 i=3; i<=500; ++i)
test(i);
for(__int64 i=3; i<=500; ++i)
printf("%d ", arr[i]);
return 0;
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课