- 2023-12-16计概杂烩2021
2021期末A+BProblem?#include<stdio.h>intmain(void){inta,b,d;charc;scanf("%d%c%d",&a,&c,&b);if(c=='+')d=a+b;if(c=='-')d=a-b;if(c=='*')d=a*b;if(c=='/')d=
- 2023-12-16计概杂烩2022
2022期末直角三角形的面积#include<stdio.h>#include<stdlib.h>#include<math.h>intmain(){ inta,b,c;scanf("%d%d%d",&a,&b,&c); doublep=(a+b+c)/2; doubles=sqrt(p*(p-a)*(p-b)*(p-c)); printf("%.2lf\n",s);
- 2023-12-16计概杂烩2022
2022期末直角三角形的面积#include<stdio.h>#include<stdlib.h>#include<math.h>intmain(){ inta,b,c;scanf("%d%d%d",&a,&b,&c); doublep=(a+b+c)/2; doubles=sqrt(p*(p-a)*(p-b)*(p-c)); printf("%.2lf\n",s);
- 2023-12-16计概杂烩2021
2021期末A+BProblem?#include<stdio.h>intmain(void){inta,b,d;charc;scanf("%d%c%d",&a,&c,&b);if(c=='+')d=a+b;if(c=='-')d=a-b;if(c=='*')d=a*b;if(c=='/')d=
- 2023-12-15计概杂烩2019
2019期末癌细胞体积#include<stdio.h>doubler;intmain(void){scanf("%lf",&r);printf("%.3lf",4.0*3.14159*r*r*r/3); return0;}寻找三角形#include<stdio.h>/*C语言初始模板程序*/intmain(void){inta,b,n,ans=0;
- 2023-12-15计概杂烩2020
2020计概计算圆柱体的表面积#include<stdio.h>intmain(void){doubler,h;scanf("%lf%lf",&r,&h);printf("Area=%.3lf\n",3.14159*r*(r+h)*2); return0;}最近的食堂#include<stdio.h>#include<math.h>intm
- 2023-12-15计概杂烩2018
2018计概期末就医问题#include<stdio.h>/*C语言初始模板程序*/intmain(void){chara[2]={'B','A'};intx;scanf("%d",&x);printf("%c\n",a[x%2]); return0;}马虎的佩奇#include<stdio.h>#defineeps0.000
- 2023-12-15计概杂烩2017
2017计概期末探险家丁丁#include<stdio.h>/*C语言初始模板程序*/intmain(void){doublef;scanf("%lf",&f);printf("%.5lf",5.0*(f-32)/9); return0;}摘礼物#include<stdio.h>inta[2000];intmain(void){intn,k,ans
- 2023-12-15计概杂烩2016
2016期末三角形判断#include<stdio.h>/*C语言初始模板程序*/intmain(void){inta,b,c;scanf("%d%d%d",&a,&b,&c);if(a+b>c&&a+c>b&&b+c>a)printf("yes\n");elseprintf("no\n"); r
- 2023-12-15计概杂烩2014
2015两点间距离#include<stdio.h>#include<math.h>doublex1,y11,z1,x2,y2,z2;intmain(void){ scanf("%lf,%lf,%lf\n%lf,%lf,%lf",&x1,&y11,&z1,&x2,&y2,&z2); doublesqu=(x1-x2)*(x1-x2)+(y11-y2)*(y11-y2)+(z1-z2)
- 2023-08-14C++系列一:语言基础-杂烩2
@目录前言:信号处理前言:继续……信号处理信号是由操作系统传给进程的中断,会提早终止一个程序。头文件中。SIGABRT 程序的异常终止,如调用abort。SIGFPE 错误的算术运算,比如除以零或导致溢出的操作。SIGILL 检测非法指令。SIGINT 程序终止(interrupt)信号。SIGSEGV 非
- 2023-08-04数据结构杂烩
线段树P4681[THUSC2015]平方运算简要题意给定一个序列,区间.map([](intx){x=x*x%p;});,区间求和。p给定,为小质数。\(N,M\le105\)。题解而把一个数看作一个点,向其平方取模连一条边,则最终必然构成一个基环森林,注意到\(P\)很小,每个数经过至多\(11\)次迭代之后