算法竞赛入门经典
文章平均质量分 76
PRISMATIC2017
Dance Dance Dance to the Distortion~
展开
-
程序设计入门
圆柱体的表面积#include<stdio.h>#include<math.h>int main(){ const double pi=acos(-1.0); double r,h,s1,s2,s; scanf("%lf%lf",&r,&h); s1=pi*r*r; s2=2*r*pi*h; s=2.0*s1+s2; printf("ar原创 2017-03-28 23:23:15 · 278 阅读 · 0 评论 -
STL初步--排序与检索
排序与检索原创 2017-03-22 20:46:13 · 366 阅读 · 0 评论 -
循环结构程序设计
FOR对于for循环,建议尽量缩短变量的定义范围,例如在初始化部分定义循环变量。for(int i=0;i<10;i++)aabb(7744)输出所有形如aabb的4位完全平方数;#include<stdio.h>#include<math.h>int main(){ for(int a=1;a<=9;a++) { for(int b=1;b<=9;b++)原创 2017-03-29 22:40:01 · 454 阅读 · 0 评论 -
数组和字符串
数组的声明:int a[maxn]maxn必须是常数,不能是变量a[n++]:首先赋值a[n]=x, 然后执行n=n+1; a[++n]:先n=n+1, 然后用加一之后的n赋值a[n]=x; 数组最好定义在main函数外面,只有放在外面的时候,数组才可以开得很大,放在main函数里面时,数组稍大就会异常退出数组不能进行赋值操作,int a[maxn], b[maxn], 要原创 2017-04-05 18:39:43 · 376 阅读 · 0 评论