取一组数据的最大值和最小值:(实验课第一题给我整傻了)先定义两个变量max,min,注意,这是变量而不是函数,所以在后面用的时候只起到了一个比较的作用。例如if(c>max)max=c.就是将这组数据的每一个数据与max比较,取较大的那一个。#include<stdio.h>intmain(){inta,b,c,max,min;while(scanf("%d"
分类:
其他好文 时间:
2020-11-06 01:32:35
阅读次数:
18
// ex1.cpp #include <stdio.h> int main() { int a=5, b=7, c=100, d, e, f; d = a/b*c; e = a*c/b; f = c/b*a; printf("d=%d, e=%d, f=%d\n",d,e,f); return 0 ...
分类:
其他好文 时间:
2020-11-06 01:25:28
阅读次数:
20
#include <iostream> #include <vector> #include <stack> #include <queue> template <class T> typedef struct node { node* left; node* right; T val; std:: ...
分类:
其他好文 时间:
2020-11-06 01:25:12
阅读次数:
16
链接 : http://codeforces.com/problemset/problem/1443/C 标签 : binary search greedy sorting *1400 二分答案 AC代码 #include <bits/stdc++.h> using namespace std; # ...
分类:
其他好文 时间:
2020-11-06 01:18:03
阅读次数:
19
题意简述 有一个$k$维空间,每维的跨度为$L$,即每一维的坐标只能是$0,1, \cdots ,L-1$。每一步你可以移动到任意一个曼哈顿距离到自己小于等于$d$的任意一个合法坐标。求一条空间中合法的哈密顿路。即,找一条经过且仅经过空间中每一个点一次的路径。 子任务编号 分值 k= L= d= 1 ...
分类:
其他好文 时间:
2020-11-06 01:11:40
阅读次数:
12
C语言是一门结构化的程序设计语言1.顺序结构2.选择结构3.循环结构什么是语句?C语言中由一个分号;隔开的就是一条语句比如printf(“hehe”);1+2;分支语句(选择结构)if语句1if(表达式)单分支语句;如果if是真那么语句执行否则什么都不执行#include<stdio.h>intmain(){inta=0;printf("你打了多少行有效代码?\n"
分类:
编程语言 时间:
2020-11-06 00:48:55
阅读次数:
22
switch语句改为多态结构更好些。 1. 常规switch #include <iostream> enum EnumType { enumOne, enumTwo, enumThree }; void showMessage(int type) { switch (type) { case en ...
分类:
编程语言 时间:
2020-11-04 19:20:04
阅读次数:
35
最短路 SPFA #include <bits/stdc++.h> using namespace std; #define N 10001 #define M 500001 struct node{ int to,w,next; }edge[M]; int cut=0; int head[N]; ...
分类:
编程语言 时间:
2020-11-04 18:47:58
阅读次数:
18
#include <stdio.h> int main() { int a=5, b=7, c=100, d, e, f; d = a/b*c; e = a*c/b; f = c/b*a; printf("d=%d, e=%d, f=%d\n",d,e,f); return 0; } 在int型中, ...
分类:
其他好文 时间:
2020-11-04 17:46:57
阅读次数:
13
1 #include <bits/stdc++.h> 2 using namespace std; 3 const int mac=4e5+50; 4 int head[mac],vis[mac],dis[mac]; 5 int n,m,num,i,j,t; 6 struct edge{ 7 int ...
分类:
其他好文 时间:
2020-11-04 17:45:08
阅读次数:
15