上一页 1 ··· 4 5 6 7 8
摘要: const int N=120; int father[N]; int rank1[N]; void init(int Size) { for(int i=1;i<=Size;++i) father[i]=i,rank1[i]=0; } int Find(int x) { while(x!=fath 阅读全文
posted @ 2020-01-23 18:20 waryan 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2020-01-16 13:18 waryan 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 1 #include<iostream> 2 using namespace std; 3 int main() { 4 int a,b; 5 int n; 6 while(cin >> n) { 7 cin >> a; 8 for(int i=1;i<n;i++) { 9 cin >> b; 10 阅读全文
posted @ 2020-01-16 12:16 waryan 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 感觉这道题有点蠢,只要硬磕就可以做出来。。。。但是没有用指针,看到网上的都比较复杂我就给个我的简单做法; 1 #include<stdio.h> 2 3 int vis[100]; 4 5 int main() 6 { 7 int n,m,i,k,count=0; 8 scanf("%d%d",&n 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 题面 001:编程填空:学生信息处理程序 1 #include <iostream> 2 #include <string> 3 #include <cstdio> 4 #include <cstring> 5 #include <sstream> 6 #include <cstdlib> 7 us 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题面 001:返回什么才好呢 未懂 1.A& GetObj()//没有明白此处的this指针,定义这个函数的作用为没有明白 1 #include <iostream> 2 using namespace std; 3 class A { 4 public: 5 int val; 6 7 A(int 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(386) 评论(0) 推荐(0) 编辑
摘要: 问题: 如果正整数大于了1000有什么影响? 1.递推式gcd: 1 int gcd(int a,int b) 2 { 3 while(b>0) 4 { 5 int c=a%b; 6 a=b; 7 b=c; 8 } 9 return a; 10 } 2.递归式gcd: 1 int gcd(int a 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 001:简单的swap 1 #include <iostream> 2 using namespace std; 3 class A 4 { 5 public: 6 int x; 7 int getX() { return x; } 8 }; 9 void swap( 10 // 在此处补充你的代码 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(298) 评论(0) 推荐(0) 编辑
摘要: 1.油田连通块 链接地址:地址 递归DFS 1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<cstring> 5 using namespace std; 6 char map[110][110]; 7 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 1 do{ 2 scanf("%d",&a[i++]); 3 count++; 4 }while(getchar()!='\n'); 5 6 \\回车结束类问题终结 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 一:求约数个数 约数个数定理: a.分解质因数(一个合数可以分通过质因数分解彻底) b.因数和(如何得来:将分解质因数的分开然后相乘共f(n)个) int get_num(int n) { int tot=1; for(int i=2;i*i<=n;++i) { if(n%i==0) { int x 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1.普通快速幂 快速幂模板: 1 int Quick_pow(int a,int b) 2 { 3 int ans=1; 4 while(b){ 5 if(b&1) 6 ans=ans*a; 7 a=a*a; 8 b>>=1; 9 } 10 return ans; 11 } 矩阵快速幂模板 1 ma 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 大一上学期c语言课设时候完成了第一个千行代码程序,这也是上大学后第一次的课设任务。 程序中我的管理员部分全部用链表实现的。用户部分读入用户信息和写出用户信息是用“结构体”实现的,但是其中的功能部分仍然用链表实现。 1.课设任务如下: 任务:火车订票系统设计 功能:设计一-火车订票系统,使之能提供下列 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(1455) 评论(0) 推荐(1) 编辑
该文被密码保护。 阅读全文
posted @ 2020-01-12 11:50 waryan 阅读(22) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8