
总结经验
z_x_b5
这个作者很懒,什么都没留下…
展开
-
登陆的界面部分实现
#include "stdio.h " #include "conio.h " void passwordInput(char *password); void main() { char password[30]; printf( "Please input the password: "); passwordInput(pass转载 2012-03-26 23:00:53 · 482 阅读 · 0 评论 -
c++从文件读取数据到字符串
C++中利用ifstream来读文件,例如:ifstream in("data2.txt"); string m_zStr; m_zStr 如何把一个文本文件一次行读到一个string对象中,方法有两种: std::ifstream in("some.file"); std::istreambuf_iterator beg(in), end; std::string st转载 2012-03-28 23:41:58 · 3108 阅读 · 0 评论 -
注意字符数组最后会自动加\0
今天做了一道考研题 规定数组大小为200 但是我没注意到后尾需要加\0 后来果断没有A过去 很伤心 反复不断地尝试怎么都不行 后来经一位仁兄点拨 瞬间豁然。。。。。 #include #include #include using namespace std; char c[200]; int main() { int i,n; while(gets(c原创 2012-03-15 17:57:08 · 1983 阅读 · 0 评论 -
中国剩余定理
PKU 1006 Biorhythms 2012-04-15 11:02:34| 分类: 数论|字号 订阅 中国剩余定理 题目大意:人的身体,情感,智力的高峰低谷都由周期,分别是23天,28天和33天,现在给出身体,情感,智力的起始天,请计算由此天开始的第几天会达到三个方便的峰值,输出此峰值。 算法分析: 思路:运用中国剩余定理解得基准数转载 2012-10-24 20:58:57 · 667 阅读 · 0 评论 -
N!的最高位
题目传送门 Note:本题直接计算一定会超时,故需要用Stirling公式求其最高位。。。。。。#include #include const double Pi = 3.14159265358979323846; const double E = 2.71828182845904523536; const int m[9] = {1,1,2,6,2,1,7,5,4}; int main原创 2013-04-05 17:03:52 · 811 阅读 · 0 评论