- 博客(79)
- 问答 (1)
- 收藏
- 关注
原创 ¥1-3 SWUST oj 942: 逆置顺序表
逆置顺序表题目描述源代码题目描述源代码#include<iostream>#include<stdlib.h>#include<malloc.h>using namespace std;typedef char ElemType;class SqList { public: ElemType data[100]; int length;};void CreateList(SqList *&L,ElemType a[],int n)//
2021-09-04 19:23:11
168
原创 ¥1-2 例2.2 将两个集合的并集放到线性表中
将两个集合的并集放到线性表中题目描述样例输入样例输出源代码题目描述样例输入21 335 3 7样例输出1 3 5 7源代码#include<iostream>#include<malloc.h>using namespace std;typedef int ElemType;const int MaxSize = 1000; //定义最大储存数class SqList{public: int data[MaxSize]; //结构体
2021-09-04 19:15:41
140
原创 ¥1-1 SWUST oj 941: 有序顺序表的合并操作的实现
有序顺序表的合并操作的实现题目描述源代码题目描述源代码#include<iostream>#include<malloc.h>using namespace std;typedef int ElemType;const int MaxSize = 1000; //定义最大储存数class SqList{public: int data[MaxSize]; //结构体数组 int length; // 长度};voi
2021-09-04 19:07:06
243
原创 @5-1 CCF 2019-12-1 报数
报数题目描述样例源代码关于这题题目描述样例源代码#include <iostream>#include <algorithm>using namespace std;int judge(int n){ if (n % 7 == 0) { return 1; } while (n) { if (n % 10 == 7) { return 1; } n /= 10; } return 0;}int main(){ int
2021-08-27 20:42:57
101
原创 @4-1 CCF 2020-06-1 线性分类器
线性分类器题目描述样例源代码关于这题题目描述样例源代码#include<iostream>#include <vector>using namespace std;vector<int> A1, A2;vector<int> B1, B2;int main(){ int N, M; cin >> N >> M; while (N--) { int x, y
2021-08-26 20:15:59
107
原创 @3-2 CCF 2020-12-2 期末预测之最佳阈值
期末预测之最佳阈值题目描述输入与输出样例源代码关于这题题目描述输入与输出样例源代码#include<iostream>#include<algorithm>using namespace std;pair<int, int> n[100005]; //每个pair存储一个同学的y和resultint re0[100005]; //记录该位置及前面的result为0的个数int re1[100005];
2021-08-25 18:55:03
134
原创 @3-1 CCF 2020-09-1 称检测点查询
称检测点查询题目描述样例源代码关于这题题目描述样例源代码#include <iostream>#include <cmath>#include <algorithm>using namespace std;class Position {public: int distance; int num;};bool compare(Position a, Position b) { if (a.distance != b
2021-08-25 17:18:31
147
原创 @2-1 CCF 2020-12-01 期末预测之安全指数
期末预测之安全指数题目描述样例源代码关于这题题目描述样例源代码#include<iostream>using namespace std;int main(){ int n, h, k; int sum = 0; int y; cin >> n; while (n--) { cin >> h >> k; sum += h * k; } y = max(0, sum); cout << y <<
2021-08-24 16:08:13
116
原创 ~7 ccf 2021-04-1 灰度直方图
灰度直方图题目描述样例源代码关于这题题目描述样例源代码#include<iostream>using namespace std;int arr[300];int main(){ int n, m, l; int mumber; cin >> n >> m >> l; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { cin >
2021-08-23 16:08:03
180
原创 *7-2 CCF 2015-09-2 日期计算
日期计算题目描述源代码题目描述源代码#include<iostream>using namespace std;int days[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };int isleapyear(int year){ return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) ? 1 : 0;}int main(){ int
2021-07-20 09:22:05
150
原创 *7-1 CCF 2015-09-1 数列分段
数列分段题目描述源代码关于这题题目描述源代码#include<iostream>using namespace std;int main(){ int n, last, current, sum=0; cin >> n; cin >> last; sum = 1; for (int i = 1; i < n; i++) { cin >> current; if (last != current) sum++; la
2021-07-20 09:19:37
125
原创 *6-3 节约小能手
节约小能手题目描述源代码关于这题题目描述源代码#include<cstdio>#include<cstdlib>#include<cstring>#include<cmath>#include<iostream>#include<algorithm>using namespace std;const int N = 100000;int a[N + 1];int b[N + 1];bool cmp(int
2021-07-19 11:00:24
106
原创 *6-2 CCF 2015-03-3 节日
节日题目描述源代码题目描述源代码#include<iostream>#include<cstring>#include<vector>#include<algorithm>using namespace std;const int N = 1000;int monthdays[2][13] = { {0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30
2021-07-19 10:16:49
93
原创 *6-1 CCF 2015-03-2 数字排序
数字排序题目描述源代码关于这题题目描述源代码#include<iostream>#include<cstring>#include<vector>#include<algorithm>using namespace std;int n;const int N = 1005;int rnum[N + 1];struct number{ int num;//数字 int count;//次数}num[N + 1];bool cmp
2021-07-19 09:52:31
86
原创 *5-2 CCF 2014-12-3 集合竞价
集合竞价题目描述源代码题目描述源代码#include<iostream>#include<cstring>#include<vector>using namespace std;const int N = 5000;struct Order{ double price; int num; int sell;//交易状态:0-买入 1-卖出 -1 取消} order[N + 1];vector<double>
2021-07-18 11:44:29
148
原创 *5-1 CCF 2015-03-1 图像旋转
图像旋转题目描述源代码关于这题题目描述源代码#include<iostream>#include<cstring>using namespace std; //CCF 2015-03-1 图像旋转const int N = 1000;int flag[N + 1][N + 1];int main(){ int n, m; cin >> n >> m; int i, j=1; int a = 1; int b = 1; for
2021-07-18 10:08:02
89
原创 *4-2 CCF 2014-12-2 Z字形扫描
Z字形扫描题目描述样例源代码关于这题题目描述样例源代码#include<iostream>#include<cstring>using namespace std;const int N = 500;int flag[N + 1][N + 1];int n;int main(){ cin >> n; int a=1, b=1; int i, j; for (i = 1; i < n + 1; i++) { for (j =
2021-07-17 18:09:25
103
原创 *4-1 CCF 2014-12-1门禁系统
门禁系统题目描述源代码题目描述源代码#include<iostream>#include<cstring>using namespace std;const int N = 1000;int a[N + 1];int b[N + 1];int main(){ int n; cin >> n; memset(b, 0, sizeof(b)); for (int i = 0; i < n; i++) { scanf("%d", &
2021-07-17 15:19:16
118
原创 *3-4 CCF 2014-09-3 字符串匹配
字符串匹配题目描述源代码关于这题题目描述源代码#include<iostream>#include<cstring>using namespace std;const int N = 100;//CCF 2014-09-3 字符串匹配int main(){ char key[N + 1], s[N + 1], lowkey[N + 1], lower[N + 1]; int opt, n; cin >> key >> opt &g
2021-07-17 09:37:22
133
原创 *3-3牛客网 重新排列
重新排列题目描述样例源代码关于这题题目描述样例源代码#include<iostream>using namespace std;string s = "puleyaknoi";const int maxn = 1e5 + 10;const int inf = 0x3f3f3f3f;int a[maxn], b[maxn];char c[maxn];int solve() //判断函数,判断元素的个数是否满足题目要求{ for (int i = 0; i <
2021-07-16 16:33:59
84
原创 *3-2 CCF 2014-09-2 画图
画图题目描述样例源代码关于这题题目描述样例源代码#include <iostream>#include <cstring>using namespace std;const int N = 100;int flag[N + 1][N + 1];int main(){ int n, x1, y1, x2, y2, sum = 0; // 变量初始化 memset(flag, 0, sizeof(flag)); // 输
2021-07-16 11:29:56
98
原创 *3-1 CCF 2014-09-1 相邻数对
相邻数对题目描述源代码关于这题题目描述源代码#include<iostream>using namespace std;int a[1005];int main(){ int n; cin >> n; for (int i = 0; i < n; i++) { scanf("%d", &a[i]); } int i, j; int count = 0; for (i = 0; i < n; i++) { for (j =
2021-07-16 10:29:30
97
原创 *2-4 每日温度 *2-5 接雨水
参考:https://leetcode-cn.com/problems/daily-temperatures/solution/yi-pian-ti-jie-gao-ding-dan-diao-zhan-we-2pkf/
2021-07-15 15:14:40
114
原创 *2-3 OJ 1164 导弹拦截之升级版
导弹拦截之升级版题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include<stdio.h>#include<algorithm>using namespace std;int main(){ int n,i; while(scanf("%d",&n)!=EOF) { int a[1000]; for(i=0;i<n;i++)
2021-07-15 14:49:38
288
原创 *2-2 OJ 1163 导弹拦截之测试版
导弹拦截之测试版题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include<stdio.h>int n,a[1000];int b[1000];int top;int find(int x){ int l=0,r=top; int mid; while(r>=l) { mid=(l+r)/2; if(x>=b[mid]) {
2021-07-15 14:44:01
398
原创 *2-1 OJ 254 翻煎饼
翻煎饼题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include<stdio.h>#include<stdlib.h>int a[1002]={0};bool flag=true;//是否满足非从小到大排序 int dex=0;//已经排好位置的数量 int conut=0;//最大值下标 int ans=0; //翻转次数 void print(int n){ for(int i=1;i<=n;
2021-07-15 14:41:21
486
原创 *1-5 OJ 642 俄式乘法
俄式乘法题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include <iostream>using namespace std;int calculate(int n, int m) { int s = 0; while (n != 1) { if (n % 2 != 0) { cout << m << " " << "+" <<
2021-07-14 13:13:29
223
原创 *1-4 OJ 605 格雷码
格雷码题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include <stdio.h>#include <string.h>#include<iostream>#include<stack>using namespace std;int main() { int n; stack<int>q; while (cin >> n) { int a[1
2021-07-14 13:10:25
277
1
原创 *1-3 OJ 291 老鼠与猫的交易
老鼠与猫的交易题目描述输入输出样例输入样例输出源代码题目描述输入输出样例输入样例输出源代码#include <stdlib.h>#include <stdio.h>int main(){ int m; int n; int k; int i; int a[1001],b[1001]; double sum=0; double p[1001]; // double max = 0;
2021-07-14 13:03:02
393
原创 *1-2 OJ 190 游程编码
游程编码题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include <stdio.h>#include <string.h>int main(){ char str[105]; int i; while(scanf("%s",str)!=EOF) { int k=0; char a[105]={'\0'}; int b[105]={0
2021-07-14 12:44:01
162
原创 *1-1 OJ 56 Hamming Distance
Hamming Distance题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include <stdio.h>#include <string.h>int main(){ int i,count; char str_1[105]; char str_2[105]; while(scanf("%s",str_1)&&str_1[0]!='X') {
2021-07-14 12:38:30
111
原创 #25-1 OJ 78 计算生日星期几
计算生日星期几题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include<stdio.h>int main(){ int year, month, day, allday; int i, j; while (scanf("%d %d %d", &year, &month, &day) != EOF)//保证输入格式符合要求 { allday = 0; for (i = 1; i <
2021-04-19 12:45:14
167
原创 #23-5 OJ 86 杨辉三角形
杨辉三角形题目描述输入输出样例输入样例输出源代码关于这题题目描述输入输出样例输入样例输出源代码#include<stdio.h>int main(){ int y[100][100] = { 0 }; int n; int i, j; while (scanf("%d", &n) != EOF && n!=0) { y[0][1] = 1; for (i = 1; i < n + 1; i++) { for
2021-04-18 09:23:46
295
apache-jena-3.9.0
2022-11-18
win10 Jena + fuseki
2022-11-18
在哪里能找到cpplint的规则
2022-04-13
TA创建的收藏夹 TA关注的收藏夹
TA关注的人