• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






yogurt_莹

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 下一页

2018年9月30日

2005.第几天?
摘要: #include<stdio.h> int main(){ int day=0,y=0,m=1,d=0; scanf("%d/%d/%d",&y,&m,&d); switch(m-1){ case 11:day+=30; case 10:day+=31; case 9:day+=30; case 8 阅读全文
posted @ 2018-09-30 22:36 yogurt_莹 阅读(55) 评论(0) 推荐(0)
 
2004.成绩转换
摘要: #include<iostream> using namespace std;int main(){ int a; cin>>a; if(90<=a<=100)cout<<"A"<<endl; else if(80<=a<90)cout<<"B"<<endl; else if(70<=a<80)co 阅读全文
posted @ 2018-09-30 22:35 yogurt_莹 阅读(89) 评论(0) 推荐(0)
 
2003.求绝对值
摘要: #include<stdio.h> int main(){ float a; scanf("%f",&a); if(a>0)printf("%.2f",a); else {a=a*(-1); printf("%.2f",a); } return 0; } Problem Description 求实 阅读全文
posted @ 2018-09-30 22:06 yogurt_莹 阅读(88) 评论(0) 推荐(0)
 
2002.计算球体积
摘要: #include<stdio.h> #define PI 3.1415927 int main(){ float r,v; scanf("%f",&r); v=((PI*r*r*r)*4)/3; printf("%.3f",v); return 0; } Problem Description 根据 阅读全文
posted @ 2018-09-30 00:02 yogurt_莹 阅读(95) 评论(0) 推荐(0)
 

2018年9月29日

2001.计算两点间的距离
摘要: #include<stdio.h> #include<math.h> int main(){ float a,b,c,d,s; while(scanf("%f%f%f%f",&a,&b,&c,&d)!=EOF){ s=sqrt((a-c)*(a-c)+(b-d)*(b-d)); printf("%. 阅读全文
posted @ 2018-09-29 23:55 yogurt_莹 阅读(96) 评论(0) 推荐(0)
 
2000.ASCII码排序
摘要: #include<stdio.h> int main(){ char a,b,c,d,x,y,z; while(scanf("%c%c%c%c",&a,&b,&c,&d)!=EOF){ if(a>b){x=a;a=b;b=x;} if(a>c){x=a;a=c;c=x;} if(b>c){x=b;b 阅读全文
posted @ 2018-09-29 23:43 yogurt_莹 阅读(108) 评论(0) 推荐(0)
 

2018年9月20日

冒泡排序法
摘要: #include<iostream> #include<vector> using namespace std; int main(){ int n,x; cout<<"请输入要比较的数的个数:"; cin>>n; vector<int> v(n); for(int i=0;i<v.size();i 阅读全文
posted @ 2018-09-20 22:08 yogurt_莹 阅读(95) 评论(0) 推荐(0)
 
选择排序法
摘要: #include<iostream> #include<vector> using namespace std; int main(){ int n,x; cout<<"请输入要比较的数的个数:"; cin>>n; vector<int> v(n); for(int i=0;i<v.size();i 阅读全文
posted @ 2018-09-20 22:07 yogurt_莹 阅读(115) 评论(0) 推荐(0)
 

2018年9月18日

打印表头函数
摘要: #include<iostream> using namespace std; void TableHead(); //声明打印表头函数 int main(){ TableHead(); //调用打印表头函数 system("pause"); return 0; } void TableHead() 阅读全文
posted @ 2018-09-18 23:31 yogurt_莹 阅读(155) 评论(0) 推荐(0)
 
值传递与地址传值的区别
摘要: #include<iostream> using namespace std; int main(){ int a,b; cin>>a>>b; cout<<a<<b<<endl; //第一次输出a,b swap(a,b); //交换后输出b,a cout<<a<<b<<endl; //调用后输出a, 阅读全文
posted @ 2018-09-18 23:20 yogurt_莹 阅读(205) 评论(0) 推荐(0)
 
上一页 1 2 3 4 下一页