小白也能看懂
2026-04-13 21:53:11
发布于:上海
31阅读
0回复
0点赞
保姆级教程,小白也能看懂!!!
首先写入头文件
#include <bits/stdc++.h>
using namespace std;
int main(){
return 0;
}
然后创建变量n,这里注意n必须是double类型而不是float
#include <bits/stdc++.h>
using namespace std;
int main(){
double n;
return 0;
}
接下来需要输入n的数值,也就是cin>>
#include <bits/stdc++.h>
using namespace std;
int main(){
double n;
cin>>n;
return 0;
}
接着需要判断n>or=3.1415926,这里采用if else 语句
#include <bits/stdc++.h>
using namespace std;
int main(){
double n;
if(n > 3.1415926){
}
else{
}
return 0;
}
最后输出yes or no
#include <bits/stdc++.h>
using namespace std;
int main(){
double n;
if(n > 3.1415926){
cout<<"yes";
}
else{
cout<<"no";
}
return 0;
}
最后是完整的,方便直接抄
#include <bits/stdc++.h>
using namespace std;
int main(){
double n;
if(n > 3.1415926){
cout<<"yes";
}
else{
cout<<"no";
}
return 0;
}
喜欢就点赞哦!
这里空空如也

有帮助,赞一个