会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
可馨&林晓洁
博客园
首页
博问
闪存
新随笔
订阅
管理
2017年11月6日
Repeating Decimals (计算循环小数)
摘要: //计算循环小数,并找出循环节以及循环节的长度,最后输出时若循环节大于50最后输出省略号。 //求循环小数,记录被除数,若被除数相同了则证明循环了。 //注意:即使是循环小数,但可能并不是从第一位小数开始循环 #include #include #include using namespace std; int rm[1010]; int vis[1000010]; int rec...
阅读全文
posted @ 2017-11-06 21:37 可馨517
阅读(476)
评论(0)
推荐(0)
编辑
2017年11月2日
二叉树的层次遍历和(叶子)节点
摘要: #include #include #include #define size 100 #define resize 10 typedef struct Bitnode{ //定义结点 char data; struct Bitnode *lchild,*rchild; }Bitnode,*Bitree; typedef struct { ...
阅读全文
posted @ 2017-11-02 11:47 可馨517
阅读(647)
评论(0)
推荐(0)
编辑
二叉树的前中后序遍历
摘要: #include #include #include #define Size 100 #define Resize 10 typedef struct Bitnode{ //定义结点 char data; struct Bitnode *lchild,*rchild; }Bitnode,*Bitree; typedef struct Stack{ ...
阅读全文
posted @ 2017-11-02 11:39 可馨517
阅读(201)
评论(0)
推荐(0)
编辑
Prime Factors
摘要: #include #include #include using namespace std; typedef long long ll; int main() { ll n; while(~scanf("%lld",&n)&&n) { if(n<0) //将前缀提前输出 { n=...
阅读全文
posted @ 2017-11-02 11:31 可馨517
阅读(199)
评论(0)
推荐(0)
编辑
2017年7月31日
浙江大学zoj 2001 Adding Reversed Numbers
摘要: #include int reverse(int num) { int ans=0; while(num>0) { ans=ans*10+num%10; num=num/10; } return ans; } int main() { int num; while(scanf("%d",&num)!=EOF)...
阅读全文
posted @ 2017-07-31 16:09 可馨517
阅读(162)
评论(0)
推荐(0)
编辑
浙江大学zoj 1003 Crashing Balloon
摘要: #include #include #include using namespace std; int at,bt; int judge(int m,int n,int p) { if(at) return 0; if(m==1&&n==1){ at=1; return 0; } if(n==1) bt=1; whil...
阅读全文
posted @ 2017-07-31 16:08 可馨517
阅读(228)
评论(0)
推荐(0)
编辑
2017年5月1日
2017.4.20实验三:5、写一个递归函数,将给定的字符串按逆序输出。(要求逆序的字符串在主调函数中输出)
摘要: #include <iostream>using namespace std;void Invert(char arr[],int &i,char str[]) { if(arr[i]=='\0') return; else { str[i]=arr[i]; i++; Invert(arr,i,st
阅读全文
posted @ 2017-05-01 11:27 可馨517
阅读(775)
评论(0)
推荐(0)
编辑
2017.4.20实验三:4、定义一个带有默认值参数的函数,通过传递不同个数的参数值,调用该函数。
摘要: #include<iostream>using namespace std;void fun(int x=3,int y=5,int z=7){ cout<<"x="<<x<<",y="<<y<<",z="<<z<<endl;}int main(){ fun(1,2,3); fun(1,2); fu
阅读全文
posted @ 2017-05-01 11:25 可馨517
阅读(219)
评论(0)
推荐(0)
编辑
2017年4月23日
2017.4.20实验三:3.输入一个无符号整数,统计该数中零的个数以及各位数字的最大值。
摘要: #include<iostream>using namespace std; int main(){ unsigned int x; cin>>x; int a,i=0,j=0,max=0; while(x>0) { a=x%10; if(a==0) j++; if(a>max) max=a; x=
阅读全文
posted @ 2017-04-23 22:08 可馨517
阅读(452)
评论(0)
推荐(0)
编辑
2017.4.20实验三:2、定义一个包含学生学号、姓名、年龄和三门课成绩的结构体,输入10个学生信息,并按总成绩由高到低的顺序排序并输出。
摘要: #include<iostream>using namespace std;typedef struct student { char name[10]; int ID; int age; float score[3]; float sum;}student;int main(){ int i, j
阅读全文
posted @ 2017-04-23 22:02 可馨517
阅读(4628)
评论(0)
推荐(0)
编辑
下一页