141、3100:【例18.3】 卡牌游戏
142、3101:练18.1 还要等多久
143、3102:练18.2 苹果和虫子
/*
1.4编程基础之逻辑表达式与条件分支 21 苹果和虫子2
http://noi.openjudge.cn/ch0104/21/
https://blog.csdn.net/yigezzchengxuyuan/article/details/86651658
*/
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
int n,x,y,num,sum;
cin>>n>>x>>y;
num=y/x;
if(y%x!=0)
num++;
sum=n-num;
if(sum<0)
{
sum=0;
}
cout<<sum;
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,x,y,z;
scanf("%d%d%d",&n,&x,&y);
if(x!=0)
{
if(y%x==0) z=n-y/x;
else z=n-y/x-1;
}
if(z<0) z=0;
printf("%d\n",z);
//system("pause");
return 0;
}
144、3103:练18.3 组别判断
145、3104:练18.4 计算邮资
#include <bits/stdc++.h>
using namespace std;
int main()
{
//sum=8
//重量在1000克以内(包括1000克), 基本费8元。
//这样写比较简单
int a,sum=8;
char b;
//输入一行,包含整数和一个字符,
//以一个空格分开,分别表示重量(单位为克)和是否加急。
scanf("%d %c",&a,&b);
if(a>1000)
{
{
if((a-1000)%500==0)
{
sum+=(a-1000)/500*4;
}
else
{
sum+=((a-1000)/500+1)*4;
}
}
}
if(b=='y')
{
sum+=5;
}
printf("%d",sum);
return 0;
}
/*
NOI / 1.4编程基础之逻辑表达式与条件分支
14计算邮资 2021.11.17 AC
http://noi.openjudge.cn/ch0104/solution/31398502/
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x,s,y,t;
char ch;
cin>>x>>ch;
if(ch=='y') s=5;
else s=0;
if(x<=1000) s+=8;
else
{
y=x-1000;
if(y%500==0) t=y/500;
else t=y/500+1;
s+=8+t*4;
}
cout<<s;
return 0;
}
146、915.在区间里 ( 课程8 ) 难度:1
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
if( a<=c && b>=c )
{
cout<<"in"<<endl;
}
else
{
cout<<"out"<<endl;
}
return 0;
}
147、916.区间交集 ( 课程8 ) 难度:1
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long a1,b1,a2,b2,c;
cin>>a1>>b1>>a2>>b2>>c;
if( a1<=c && b1>=c && a2<=c && b2>=c )
{
cout<<"in"<<endl;
}
else
{
cout<<"out"<<endl;
}
return 0;
}
148、66.内切圆 (魔法学院第10课) 难度:2
int main(){
pen.rr(100,100,0);
p.c(1);
p.oo(50);
return 0;
}
149、67.信号灯 (魔法学院第10课)
150、68.彩环 (魔法学院第10课)
小学生C++编程基础(一)--- 123题
第9关 - 课程E 数组前缀和(C++进阶课程)
第10关 - 课程F 二重循环应用1
第11关 - 课程G 冒泡、选择、插入排序、分解质因子
第12关 - 课程ZA 二维数组应用1
第13关 - 课程ZB 二维数组应用2,二维前缀和
第14关 - 课程ZC 数组的应用,置换,周期
第15关 - 课程ZD 队列的预备知识
第16关 - 课程ZE 经典的数据结构:队列
https://blog.csdn.net/dllglvzhenfeng/article/details/135198228
第17关 - 课程ZF 单调队列
https://blog.csdn.net/dllglvzhenfeng/article/details/135201172