- 博客(21)
- 收藏
- 关注
原创 2021-11-13
#include #includeusing namespace std;#define PI 3.1415926double a,b,x,y,z,angle;int main(){ scanf("%lf%lf",&a,&b); scanf("%lf%lf%lf",&x,&y,&z); angle=x+(y/60)+(z/3600); angle=angle*(PI/180); printf("%.2lf",a*(sin(angle)/cos(angle))+b)
2021-11-13 12:31:34 351
原创 2021-11-08
List item 106人点赞 17759人阅读 持续更新中。。。 Java集合总结大全 List接口与接口实现类 Set接口与接口实现类 Map接口与接口实现类 线程安全处理方法 ArrayList、LinkedList和Vector的区别 HashMap和HashTable的区别 List、Set、Map三者的区别 List接口与接口实现类 有序、不唯一 ArrayList 内部是通过数组实现的,允许对元素进行快速随机访问。 当数组大小不满足时需要增加存储能力,就要将已经有数组的数据复制到新的存.
2021-11-12 20:43:13 62
原创 2021-11-08
106人点赞 17759人阅读 持续更新中。。。 Java集合总结大全 List接口与接口实现类 Set接口与接口实现类 Map接口与接口实现类 线程安全处理方法 ArrayList、LinkedList和Vector的区别 HashMap和HashTable的区别 List、Set、Map三者的区别 List接口与接口实现类 有序、不唯一 ArrayList 内部是通过数组实现的,允许对元素进行快速随机访问。 当数组大小不满足时需要增加存储能力,就要将已经有数组的数据复制到新的存储空间中。 适合随机查找
2021-11-12 20:42:30 34
原创 2021-11-12
#include <stdio.h> void pyramid( int n );int main(){ int n; scanf("%d", &n); pyramid(n); return 0;}/* 你的代码将被嵌在这里 */
2021-11-12 19:18:18 502
原创 2021-11-10
int is_leap_year(int year) { if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) return 1; else return 0; }
2021-11-11 19:15:43 151
原创 2021-11-11
#include<stdio.h> int main(){ int year; int i=0; printf(“请输入年份:”); scanf("%d",&year); if(year%40 && year%100!=0) //判断该年份是否为普通闰年 { i=1; }else { if(year%4000) //判断该年份是否为世纪闰年 { i=1; } } if(i==1) { printf("%d年是闰年\n",year); }else {
2021-11-11 19:14:39 31
原创 2021-10-20
/** @author Ye Hongzhi 公众号:java技术爱好者 @name BubbleSort @date 2020-09-05 21:38 **/ public class BubbleSort extends BaseSort { public static void main(String[] args) { BubbleSort sort = new BubbleSort(); sort.printNums(); } @Override protected void sort
2021-11-09 11:19:48 182
原创 2022-11-06
#include<stdio.h> int main() { int year; scanf("%d",&year); if((year%4000)||(year%40)&&(year%100!=0)) printf("%d是闰年",year); else printf("%d不是闰年",year); return 0; }
2021-11-09 11:17:46 36
原创 2021-11-09
import java.util.Scanner; /** * while循环 * 输入一批整数,输出其中的最大值和最小值,输入数字0时结束循环 * @author Administrator * /public class Compare { public static void main(String[] args) { /声明/ int num;//输入的整数 int max;//最大值 int min;//最小值 //扫描器 Scanner input =new Scanner(Sy
2021-11-09 08:23:48 40
原创 2021-11-07
#include<stdio.h> #include<math.h>#include<stdlib.h>int main() { int side1; //直角边1 int side2; //直角边2 int hypotenuse; //斜边 int count = 0; for (hypotenuse = 1; hypotenuse <= 500; hypotenuse++) { for (side1
2021-11-07 15:58:22 42
原创 2021-11-05
#include <stdio.h> int main(){ int year; printf(“请输入年份:”); scanf("%d",&year); if(year%400 == 0) printf("%d是闰年\n",year); else { if(year%4 == 0) { if(year%100 != 0) printf("%d是闰年\n",year); else printf("%d不是闰年\n",year); } else print
2021-11-05 19:03:13 39
原创 2021-11-04
#include #include using namespace std; int main() { float a, b, c, x1, x2, discriminant, realPart, imaginaryPart; cout << "输入 a, b 和 c: "; cin >> a >> b >> c; discriminant = bb - 4ac; if (discriminant > 0) {
2021-11-04 18:19:57 43
原创 2021-11-03
#include <stdio.h> int main() { int n; printf(“请输入一个1-100之间的整数:\n”); scanf("%d", &n); int m = 0; for (int i = 2; i < n; i++ ) { if(n % i == 0) { m++; } } if (m == 0) { printf("%d是素数\n", n); } else { printf("%d不是素数\n", n); } return 0;
2021-11-03 19:10:31 37
原创 2021-11-02
#include<stdio.h> int main(){int a;int i=0;long long b=0;long long sum=1;scanf("%d",&a);for(i=1;i<=a;++i){sum*=i;b+=sum;}printf("%lld",b);return 0;}
2021-11-02 09:28:09 37
原创 2021-11-01
#include<stdio.h> #include<math.h>int main() { const double Pi=3.14; //定义pi的值double a; a=sin(45*180/Pi); //角度转化为弧度printf("%f",a); //printf的正确格式}
2021-11-01 12:17:42 38
原创 2021-10-25
#include<stdio.h> #include<math.h> int main() { float a,b,c; scanf("%f %f %f",&a,&b,&c); double delt = bb-4a*c; //printf("%.1f\n",delt); double x1,x2; double x; if(a!=0&&b!=0&&c!=0){ if(delt>0){ x1 = (-b+sqrt(delt
2021-10-30 23:15:39 37
原创 2021-10-30
int compare01(int a, int b, int c){ //最原始的if条件判断 if( a > b){ if( a > c){ return a; }else{ return c; } }else{ if( b > c){ return b; }else return c; } } int compare02(int a, int b, int c){ // 三目运算符,略沙雕 return (a > b ? a : b) > c ? (a > b ?
2021-10-30 23:13:56 38
原创 2021-10-29
#include<stdio.h> #include<math.h> int main(){ double a,b,c,delta,x1,x2,m,n,i,j; scanf("%lf%lf%lf",&a,&b,&c); if(fabs(a)<=1e-6){ if(fabs(b<=1e-6)) printf(“Not an equation\n”); else printf("%.2lf\n",-c/b); } else { delta=bb-4ac
2021-10-29 18:46:11 43
原创 2021-10-28
#include<stdio.h> int mian() { int a; scanf("%d",&a); if(a%20){ printf("%d是一个偶数",a); } else if(a%21){ printf("%d是一个奇数",a); } retun 0; }
2021-10-28 23:18:21 48
原创 2021-10-28
#include<stdio.h> int main(){ int digit, other, blank; char ch; digit=0,blank=0,other=0; //首先定义计数变量并初始化 while((ch=getchar())!=’\n’) { //当输入不等于回车时循环 //根据各种情况用if语句判断来设置变量的值 if(ch>=‘0’&&ch<=‘9’) digit++;
2021-10-28 23:03:17 50
原创 2021-10-28
#include<stdio.h> int main() { printf(“hello world!”); return 0; }
2021-10-28 22:58:32 37
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人