c++一级练习题(1)

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

int a,b;

cin>>a>>b;

cout<<a*b;

return 0;

}

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

int a;

cin>>a;

if(a%1 == a)

{

cout<<"no";

}

else

{

cout<<"yes";

}

return 0;

}

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

int n,k;

cin>>n>>k;

int sim;

for(int i = 0;i<=n;i++)

{

int g = i%10;

int s = i/10%10;

int b = i/100%10;

if(i/7 == 0||g == 7||s == 7||b == 7)

{

sim = sim + i;

}

}

cout<<sim;

return 0;

}

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

int n;

cin>>n;

int sim;

for(int i = n;i<=0;i--)

{

for(int j = i;i<=0;j--)

{

if(i/j == 0)

{

sim = sim+i;

}

}

if(sim>=2)

{

cout<<i;

return 0;

}

else

{

sim = 0;

}

}

}

#include<iostream>

#include<iomanip>

using namespace std;

int main()

{

int a,b;

cin>>a>>b;

cout<<b<<" "<<a;

}

相关推荐
Tony Bai41 分钟前
高并发后端:坚守 Go,还是拥抱 Rust?
开发语言·后端·golang·rust
wjs20241 小时前
Swift 类型转换
开发语言
前端小L1 小时前
贪心算法专题(十):维度权衡的艺术——「根据身高重建队列」
javascript·算法·贪心算法
方得一笔1 小时前
自定义常用的字符串函数(strlen,strcpy,strcmp,strcat)
算法
秃了也弱了。1 小时前
python实现定时任务:schedule库、APScheduler库
开发语言·python
weixin_440730502 小时前
java数组整理笔记
java·开发语言·笔记
Xの哲學2 小时前
Linux SMP 实现机制深度剖析
linux·服务器·网络·算法·边缘计算
Thera7772 小时前
状态机(State Machine)详解:原理、优缺点与 C++ 实战示例
开发语言·c++
linux开发之路2 小时前
C++高性能日志库开发实践
c++·c++项目·后端开发·c++新特性·c++校招
wuk9982 小时前
使用PCA算法进行故障诊断的MATLAB仿真
算法·matlab