12 条题解

  • 3
    @ 2023-1-26 17:13:13
    #include<bits/stdc++.h>
    using namespace std;
    int main(){	
    	char a;
    	cin>>a;
    	if((int)a%2==0){
    		cout<<"NO";
    	}else{
    		cout<<"YES";
    	}
    	return 0;
    }	
    
    
    • 1
      @ 2022-8-12 18:45:43
      #include <bits/stdc++.h>
      using namespace std;
      int main()
      {
      	int n;
      	char a;
      	cin >>a;
      	n = (int)a;
          if(n%2)
              cout << "YES";
          else
              cout << "NO";
          return 0;
      }
      
      #include <stdio.h>
      #include <iostream>
      #include <math.h>
      #include <iomanip>
      using namespace std;
      int main()
      {
      	char a;
      	cin>>a;
      	if(a%2==1)
      	{
      		cout<<"YES";
      	}
      	else
      	{
      		cout<<"NO";
      	}
      }
      
      • 1
        @ 2022-7-3 10:57:47
        /*****************************************
        备注:
        ******************************************/
        #include <math.h>
        #include <stdio.h>  //  getchar();
        #include <iostream>
        using namespace std;
        int main()
        {
        	char a;
        	// cin >> a;
        	a = getchar();
        	if(a%2 == 0)
        	{
        		cout << "NO";
        	}
        	else 
        	{
        		cout << "YES";
        	}
        }
        
        • 0
          @ 2024-8-29 11:11:03

          #include<iostream> #include<iomanip> #include<cmath> using namespace std; char n; int main() { cin >> n; if (int(n)%2 != 0) { cout << "YES"; } else { cout << "NO"; } return 0; }

          • 0
            @ 2023-12-24 12:10:52

            #include<iostream> using namespace std; const int N=1e3+10; const int INF=0x3f3f3f3f; char a; int main(){ cin>>a; if(a%2==0) cout<<"NO";

            • else cout<<"YES"; }
            • 0
              @ 2023-7-1 13:01:08
              #include <iostream>
              using namespace std;
              int main()
              {
              	char a;
              	cin >> a;
              	if( (int)a % 2 != 0 )
              	{
                  	cout << "YES";
                  }
              	else
              	{
                      cout << "NO";
              	}
                  return 0;
              }
              
              • 0
                #include <cmath>
                using namespace std;
                int main()
                {
                char a;
                cin>>a;
                if((int)a%2==0)
                cout<<"NO";
                else
                cout<<"YES";
                return 0;
                
                }
                
                
                • 0
                  @ 2023-4-4 21:34:52

                  #include<bits/stdc++.h> using namespace std; int main() { char n; cin>>n; if((int)n%2==1) cout<<"YES"; else cout<<"NO"; return 0; }

                  • 0
                    @ 2023-4-1 14:25:05

                    #include <iostream> #include <iomanip> #include <cmath> using namespace std; int main() { char a; cin>>a; if(a %2 == 1) { cout<<"YES"; } else cout<<"NO"; return 0; }

                    • -1
                      @ 2021-12-5 19:07:47

                      本题在作者更新期间(2021/12/5)只能使用Python作答。 考虑到各位竞赛代码用户对Python函数的理解,把思路和代码写在这里。

                      1. 输入部分
                        使用input()函数输入。默认类型为str即字符串。
                      2. 转换为ACSII码
                        使用ord(x)函数求x的ASCII 码值。
                      3. 判断
                        Python中的判断语句形式:
                      if True:
                          ...
                      elif True:
                          ...
                      else:
                          ...
                      
                      1. 代码
                      a=ord(input())
                      if a%2==0:
                          print("NO")
                      else:
                          print("YES")
                      
                      • -2
                        @ 2022-5-1 18:01:26

                        #include <stdio.h> #include <iostream> #include <math.h> #include <iomanip> using namespace std; int main() { char a; cin >> a; if(a % 2 == 0) { cout << "NO"; } else { cout << "YES"; } return 0; }

                        • -3
                          @ 2021-12-5 19:13:16

                          重新写下Python的判断格式:

                          if [case1]:
                              {do1}
                          elif [case2]:
                              {do2}
                          else:
                              {do3}
                          

                          其中,case表示判断条件,do表示要做的事情。

                          • 1

                          信息

                          ID
                          873
                          时间
                          1000ms
                          内存
                          256MiB
                          难度
                          4
                          标签
                          递交数
                          893
                          已通过
                          380
                          上传者