09 2015 档案

ural One-two, One-two 2
摘要:One-two, One-two 2 Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Description One-two, One-two 2 Description A year ago the famo 阅读全文

posted @ 2015-09-28 10:20 逸阳 阅读(237) 评论(0) 推荐(0)

一元多项式的加减乘法
摘要:输入一元多项式的参数,然后根据一元多项式加法减法乘法的计算法则,求解最终结果。用到了结构体,指针,操作的时候要注意。不多说,上代码: 1 #include 2 #include 3 4 typedef struct node{ 5 float coef; 6 int... 阅读全文

posted @ 2015-09-24 22:06 逸阳 阅读(1102) 评论(1) 推荐(1)

ural Cipher Message
摘要:Cipher Message Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Cipher Message Description Müller tried to catch Stierlitz red-han 阅读全文

posted @ 2015-09-23 23:52 逸阳 阅读(296) 评论(0) 推荐(0)

快速幂取模算法
摘要:问题:求解ab%c1.首先看最原始的做法:1 int num=1;2 for(int i=1;i0){4 if(b%2==1){5 num=(num*a)%c; 6 }7 b/=2; //这一步将b->log2(b) 8 a=(a*a)%... 阅读全文

posted @ 2015-09-23 00:52 逸阳 阅读(1341) 评论(0) 推荐(0)

蛇形填充
摘要:蛇形填充 1 //局限性:由于编译框显示限制,只能实现1-20的功能 2 #include 3 #include 4 using namespace std; 5 #define MAXN 20 6 int a[MAXN][MAXN]; 7 8 int main(){ 9 int ... 阅读全文

posted @ 2015-09-19 17:57 逸阳 阅读(405) 评论(0) 推荐(0)

矩阵相乘
摘要:矩阵相乘的程序: 1 #include 2 #include 3 4 bool check(int row1,int col1,int row2,int col2){//检测两个矩阵是否可以相乘 5 if(row1>0&&col1>0&&row1>0&&col2>0){ 6 ... 阅读全文

posted @ 2015-09-19 14:24 逸阳 阅读(213) 评论(0) 推荐(0)

计算2的N次方&&计算e
摘要:2的N次方注意:这里在处理的时候并没有用循环来处理,而是用移位的做法。 n 2 #include 3 int main(){ 4 int time; 5 printf("要求出2的多少次方:"); 6 scanf("%d",&time) ; 7 int n... 阅读全文

posted @ 2015-09-18 21:47 逸阳 阅读(384) 评论(0) 推荐(0)

输出国际象棋&&输出余弦曲线
摘要:输出国际象棋棋盘 1 #include 2 #include 3 #include 4 int main(){ 5 int i,j; 6 SetConsoleOutputCP(437);//显示大于127的ASiic 码 7 for(i=0;i 2 #include ... 阅读全文

posted @ 2015-09-18 20:53 逸阳 阅读(226) 评论(0) 推荐(0)

打鱼晒网问题
摘要:题目描述:中国有句俗话叫“三天打鱼,两天晒网”。某人从1992年1月1日起开始“三天打鱼,两天晒网”,问:这个人在以后的某一天中是“打鱼”还是“晒网”?解决这个题目分两步:1.距起始日期的天数,2.求余的结果 代码如下: 1 #include 2 #include 3 4 typedef s... 阅读全文

posted @ 2015-09-17 13:30 逸阳 阅读(451) 评论(0) 推荐(0)

ATM模拟程序
摘要:一个很简单的ATM模拟程序 1 #include 2 void chaxun(int a3){ 3 int b; 4 b=a3; 5 printf("您的余额为:%d\n",b); 6 } 7 8 int qukuan(int a3){ 9 i... 阅读全文

posted @ 2015-09-17 11:43 逸阳 阅读(355) 评论(0) 推荐(0)

getline()函数
摘要:这是一篇关于getline()函数的博客,以总结对输入输出流的掌握,不再在这些问题上栽跟头~-------------------------- 1.首先我们知道,getline()函数的基本作用,在C++标准库里面的函数定义为:istream& getline ( istream &is ,... 阅读全文

posted @ 2015-09-14 14:16 逸阳 阅读(1720) 评论(0) 推荐(0)

AC小笔记
摘要:1:基本库函数的使用 Rand()函数,可以产生0~32767之间的随机数。 a+rand()%(b-a) 可以得到 [a,b] 之间的随机数。2:基本数据类型的使用 可以使用强制类型转换 例如:string str; cin>>str; int j=0; while(str[j]){ cha... 阅读全文

posted @ 2015-09-13 22:23 逸阳 阅读(169) 评论(0) 推荐(0)

导航