-
-
莫名其妙的notepad
-
发表于:
2010-12-1 19:15
4242
-
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;
}
[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!