10 条题解

  • 2
    @ 2023-5-23 20:21:24
    #include<bits/stdc++.h>
    using namespace std;
    int main(){	
    	double n;
    	cin >> n;
    	n=sqrt(n);
    	if(n==(int)(n)){
    		cout<<n;
    	}else{
    		cout<<"No,Chen";
    	}
    	return 0;
    }	
    
    • 0
      @ 2024-4-12 22:01:12
      #include <queue>
      #include <math.h>
      #include <stack>
      #include <stdio.h>
      #include <iostream>
      #include <vector>
      #include <iomanip>
      #include <string.h>
      #include <algorithm>
      #include <bits/stdc++.h>
      using namespace std;
      int main(){	
      	double n;
      	cin >> n;
      	n=sqrt(n);
      	if(n==(int)(n)){
      		cout<<n;
      	}else{
      		cout<<"No,Chen";
      	}
      	return 0;
      }	
      
      • 0
        @ 2024-3-31 7:48:03

        #include<iostream> using namespace std; int main(){ double n; cin >> n; n=sqrt(n); if(n==(int)(n)){ cout<<n; }else{ cout<<"No,Chen"; } return 0; }

        • 0
          @ 2023-4-4 21:22:34

          #include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a; if(sqrt(a)*sqrt(a)==a) cout<<sqrt(a); else cout<<"No,Chen"; return 0; }

          • 0
            @ 2023-1-26 16:33:01
            #include<bits/stdc++.h>
            using namespace std;
            int main(){	
            	double n;
            	cin >> n;
            	n=sqrt(n);
            	if(n==(int)(n)){
            		cout<<n;
            	}else{
            		cout<<"No,Chen";
            	}
            	return 0;
            }	
            
            
            • 0
              @ 2022-12-10 18:16:24

              来篇题解 科普一下,sqrt函数是计算一个数开根号是多少的函数

              就比方说sqrt(25)是5,因为5*5=25。同理,

              sqrt(36)=6

              ceil是指取比那个数大且离他最近的整数。ceil整数还是这个数本身。比如:

              ceil(3.141)=4

              上代码:

              #include<bits/stdc++.h>
              using namespace std;
              
              int main(){
              	int n;
              	cin>>n;
              	if(ceil(sqrt(n))==sqrt(n))cout<<sqrt(n);
              	else cout<<"No,Chen";
              	return 0;
              }
              

              因为懒所以不加注释了,看得懂吧? 欢迎来luogu找我玩!

              • 0
                @ 2022-7-2 18:10:22

                #include<stdio.h> #include<iostream> #include<math.h> using namespace std; int main() { int a; int b; cin>>a; b=sqrt(a); if(b*b==a) { cout<<b<<endl; }else { cout<<"No,Chen"<<endl; } }

                • 0
                  @ 2022-1-3 9:41:51
                  #include <stdio.h>
                  #include <iostream>
                  #include <math.h>
                  #include <iomanip>
                  using namespace std;
                  int main()
                  {
                  	int a,b;
                  	cin >>a;
                  	if(sqrt(a)*sqrt(a)==a)
                  	{
                  		cout<<sqrt(a);
                  	}
                  	else
                  	{
                  		cout<<"No,Chen";
                  	}
                  }
                  
                  • @ 2023-1-26 16:32:21

                    你的b是干什么的?

                  • @ 2023-4-3 17:13:29

                    #include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; #define LL long long const int N = 1e5 + 10; const int INF = 0x3f3f3f3f; int main() { int n; cin >> n; int b,s,g; b = n/100; s = n/10%10; g = n%10; if(bbb + ggg + sss ==n) { cout <<"YES"; } else { cout <<"NO"; } return 0; }

                • 0
                  @ 2022-1-3 9:20:55
                  #include <bits/stdc++.h>
                  using namespace std;
                  int main(){
                      int n;
                      cin>>n;
                      
                      if(int(sqrt(n))*int(sqrt(n))==n){
                          cout<<sqrt(n);
                      }else{
                          cout<<"No,Chen";
                      }
                  }
                  
                  • 0
                    @ 2021-12-4 12:29:15

                    sqrt函数:计算开方
                    用法:

                    sqrt(double x);
                    

                    作用:返回x的开方。 注意:需要包括库

                    #include <math.h>
                    

                    本题思路:判断n的开方是否为整数。(好像在C++行不通...) 附上本人AC代码:

                    //Write by: FSC711300
                    #include <bits/stdc++.h>
                    using namespace std;
                    int main(){
                        int n;
                        cin>>n;
                        
                        if(int(sqrt(n))*int(sqrt(n))==n){
                            cout<<sqrt(n);
                        }else{
                            cout<<"No,Chen";
                        }
                    }
                    
                    
                    • 1

                    信息

                    ID
                    880
                    时间
                    1000ms
                    内存
                    128MiB
                    难度
                    4
                    标签
                    递交数
                    564
                    已通过
                    258
                    上传者