CCF中学生计算机程序设计入门篇练习
调侃来自火星球的我
Hi,i'm joker.彩花
展开
-
CCF1011--正方形(C++)
#include <bits/stdc++.h>using namespace std;int main(){ double x, y; cin >> x >> y; if (x >= -1 && x <= 1 && y >= -1 && y <= 1) { cout << "Yes" << endl; }.原创 2021-08-20 17:35:29 · 595 阅读 · 0 评论 -
CCF1009--分配任务(C++)
#include<bits/stdc++.h>using namespace std;int main(){ int boys,grils; //定义整数实形变量 cin>>boys>>grils; //赋值两个数给变量 if(boys+grils<10){ //判断如果小组人数小于10输出“water” cout<<"water"<<endl; } else{ .原创 2021-08-20 11:49:33 · 386 阅读 · 0 评论 -
CCF1008--水仙花数
#include<stdio.h>int main(){int n,a,b,c;cin>>n;a=n/100;b=(n/10)%10;c=(n%10)%10;if(a*a*a+b*b*b+c*c*c==n){ cout<<"YES";}else{ cout<<"NO"; return 0;}}原创 2021-08-20 11:45:21 · 55 阅读 · 0 评论 -
CCF1007--计算余数(C++)
#include<bits/stdc++.h>using namespace std;int main(){ double a, b; cin >> a >> b; assert(a> 0 && b > 0); int k = (int)(a/b); double r = a - k*b; cout << setiosflags(ios::fixed); co.原创 2021-08-20 11:42:50 · 505 阅读 · 0 评论 -
CCF1006--捡石头(C++)
#include<bits/stdc++.h>using namespace std;int main(){ int a,b,c,d; scanf("%d %d %d",&a,&b,&c); d=20-(a+b+c); printf("%d",d); return 0;}题目描述憨厚的老农夫昨天捡到了3块小石头,他想再去捡一个小石头,让这4个石头正好一共重20斤,请问他应该去捡一个多少斤的石头?输入三个整数a,b,c,是这三个石头的重.原创 2021-08-20 11:39:19 · 1140 阅读 · 0 评论 -
CCF1005--存款收益(C++)
#include<iostream>#include<cstdio>#include<cmath>using namespace std;int main(){ double r,x,p; cin>>r>>x>>p; double a=(100+r)/100; printf("%.2lf",x*pow(a,p)); return 0; }题目描述按年利率R%存入本钱X,存.转载 2021-08-20 11:36:37 · 479 阅读 · 0 评论 -
CCF1004--填充矩形(C++)
#include<bits/stdc++.h>using namespace std;int main(){ int n,m,a,Fillin; cin>>n>>m>>a; if(1<=n,m,a<=10^9){ Fillin=(n*m)/(a*a); system("cls"); cout<<Fillin; }else{ cout<<"The input c.原创 2021-08-20 11:29:03 · 882 阅读 · 0 评论 -
CCF1003--猜数游戏(C++)
#include<iostream>#include<cstdio>using namespace std; int main(){ float num,ans; cin >> num; ans = (num*1000+num)/7/11/13; printf("%.0f",ans); return 0;}题目描述有一个“就是它”的猜数游戏,步骤如下:请你对任意输入的一个三位数x,在这三位数后重复一遍,得到一个六位数,467--&g.原创 2021-08-20 11:29:24 · 313 阅读 · 0 评论 -
CCF1002--三角形(C++)
#include<iostream>#include<cstdio>#include<cmath>using namespace std;int main(){ float a, b, c, area; cin >> a >> b >> c; float p = (a + b + c) / 2; area = sqrt(p * (p-a) * (p-b) * (p-c)); printf("%.4f", are.原创 2021-08-20 10:59:40 · 141 阅读 · 0 评论 -
CCF1001--温度转换(C++)
#include <stdio.h>int main(){ double a,b; scanf("%lf",&a); b=(a-32)*5.0/9.0;//逆推 printf("%.4lf",b); return 0;}题目描述将输入的华氏温度转换为摄氏温度。由华氏温度F与摄氏温度C的转换公式为:F=C×9/5+32。输入输入一个实数,表示华氏温度输出输出对应的摄氏温度,答案保留4位小数。样例输入50样例输出1.原创 2021-08-20 09:11:12 · 495 阅读 · 0 评论