刘汝佳--算法竞赛入门经典
坚持学习每一天
这个作者很懒,什么都没留下…
展开
-
C语言--正弦、余弦函数
#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){ const double pi = acos(-1.0); int n; scanf("%d",&n); printf("%lf %lf",sin(n/180.0*pi),cos(n/180.0*pi));}sin()函数和cos()函数的参数是弧度原型:double sin(double原创 2021-09-14 15:51:54 · 2251 阅读 · 0 评论 -
C语言--判断闰年
能被4整除但是不能被100整除能被400整除#include <stdio.h>#include <stdlib.h>int main(){ int year; scanf("%d",&year); if((year%4==0 && year%100!=0)|| year%400==0){ printf("yes"); } else{ printf("no"); }.原创 2021-09-14 15:43:37 · 124 阅读 · 0 评论 -
C语言---判断直角三角形
#include <stdio.h>#include <stdlib.h>#include <math.h>int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a<=0 || b<=0 || c<=0) { printf("not a triangle"); } else if(a+b<=c)原创 2021-09-14 15:35:10 · 2530 阅读 · 0 评论