再来更新一下博客首页的随机名言。 READ MORE →
源路径太长:源文件名长度大于文件系统支持的长度 解决方法
中文错误提示:
源路径太长:源文件名长度大于文件系统支持的长度。请尝试将其移动到具有较短路径名称的位置,或者在执行此操作前尝试将其重命名为较短的名称。
删除文件夹:是否要永久删除此文件夹?该文件夹包含名称过长且无法放入回收站的项目。
Windows shows the error:
Destination Path Too Long: The file name(s) would be too long for the destination folder. You can shorten the file name and try again, or try a location that has a shorter path.
Source Path Too Long: The source file name(s) are larger than is supported by the file system. Try moving to a location which has a shorter path name, or try renaming to shorter name(s) before attempting this operation.
软件LongPathTool可以删除上述文件名
HDOJ2054:A==B? 字符串处理、看似水题
#include
#include
using namespace std;
char a[100000], b[100000];
bool is(char *p)
{
for (; *p != ' '; p++)
if (*p == '.')return true;
return false;
}
void det(char *p)
{
for (; *p != ' '; p++);
p--;
for (; *p == '0'; p--)
*p = ' ';
if (*p == '.')*p = ' ';
}
int main()
{
while (cin >> a >> b)
{
if (is(a))det(a);
if (is(b))det(b);
if (strcmp(a, b) == 0)cout
C++ 虚调用实例
原文自http://see.xidian.edu.cn/cpp/biancheng/view/244.html
#include
#include
using namespace std;
//声明基类Student
class Student
{
public:
Student(int, string,float); //声明构造函数
void display( );//声明输出函数
protected: //受保护成员,派生类可以访问
int num;
string name;
float score;
};
//Student类成员函数的实现
Student::Student(int n, string nam,float s)//定义构造函数
{
num=n;
name=nam;
score=s;
}
void Student::display( )//定义输出函数
{
coutdisplay( );
pt=&grad1;
pt->display( );
return 0;
}
HDOJ5003:Osu!——套公式的水题
Now you are given the task to write a calculator for this system.
Input
For each test case, the first line contains an integer n, denoting the number of songs you have played. The second line contains n integers a1, a2, …, an separated by a single space, denoting the score of each song.
T<=20, n<=50, 1<=ai<=500.
Output
Your answers will be considered correct if its absolute error is smaller than 1e-5.
Sample Input
Sample Output
#include
#include
#include
#include
#include
using namespace std;
double ai[100];
int main(){
int n, i, j, cas;
double res;
scanf("%d",&cas);
while (cas--){
scanf("%d", &n);
res = 0;
for (i = 0; i= 0; i--){
res += pow(0.95, n - 1 - i)*ai[i];
}
printf("%.10lfn", res);
}
return 0;
}
POJ1852:Ants
Input
Output
Sample Input
2 10 3 2 6 7 214 7 11 12 7 13 176 23 191
Sample Output
4 8 38 207
可以认为所有的蚂蚁都朝着竿的两端前进,并且两只蚂蚁相遇时可以无视。(即,两只蚂蚁穿过对方,而没有反方向爬回去)。所以求最长最短时间,只需求蚂蚁到竿子一端的最大最小距离即可。
代码:
#include
#include
#include
#include
using namespace std;
int main()
{
int j;
scanf("%d", &j);
while (j--)
{
int L, n,ni;
int x[1000000];
memset(0, L, sizeof L);
memset(0, n, sizeof n);
scanf("%d,%d", &L, &n);
for (ni = 0; ni
DD-WRT做二级路由的设置方法
修改Chrome默认搜索引擎为Google.com
因为谷歌会把你的默认搜索引擎改为本地域名(如google.com.hk)。但从稳定性和功能性考虑的话,还是希望Chrome的默认引擎是google.com。
具体修改方法:
- 关闭Chrome
- 打开C:Users你的用户名AppDataLocalGoogleChromeUser DataDefault(Win8下,其他类似)找到Preferences文件并打开
- 找到last_known_google_url 和 last_prompted_google_url这两行,修改为Google.com即可。
打开Chrome,完毕~
FreeNAS简明U盘安装
时隔半年之后,又开始折腾FreeNAS了。才发现之前写的教程还没完工。趁此补上~
这个方法是将Img文件写到U盘上,通过U盘启动。将硬盘全部做存储用。
- 在FreeNAS官网上下载U盘版的img文件。(建议用2GB以上容量的U盘)
- 下载后得到一个.xz文件。可用7z解压后得到img映像文件。
- 用imageWriter一类工具将img文件写入U盘。即可得到FreeNAS启动U盘。
以上。之后,在Bios中选择从U盘启动,等待约两分钟之后,即可看到屏幕上显示出FreeNAS的IP地址。其他设备即可访问FreeNAS的webUI~
解决Youtube不能评论问题
在youtube发评论时,出现一个弹窗,点一下就消失了。不能发表评论。出现这种问题一般是Chrome浏览器设置不允许使用第三方Cookie。
遇到这种情况,可能是浏览器设置不允许使用第三方Cookie,可以通过以下步骤解决。
解决方法:(以Chrome为例)设置——内容设置——cookie中设置例外:允许apis.google.com即可。
具体步骤:在菜单中选择设置,进入站点设置
选择Cookies设置,然后添加一条例外规则。
填入以下地址:
apis.google.com
保存后重启浏览器生效。
欢迎留言反馈。
