1 solutions

  • 0
    @ 2025-11-5 17:31:51

    C :

    #include <stdio.h>
    
    int main(void) {
    	int n;
    	scanf("%d", &n);
    	if(n % 2 == 1)
    		printf("yes\n");
    	else
    		printf("no\n");
    	return 0;
    }
    
    

    C++ :

    #include<cstdio>
    using namespace std;
    int main()
    {
    	int n;
    	scanf("%d",&n);
    	if(n%2==1)
    	{
    		printf("yes\n");
    	}
    	else
    	{
    		printf("no\n");
    	}
    	return 0;
    }
    

    Pascal :

    program y1;
     var
      a:integer;
     begin
      readln(a);
      if a mod 2=0 then writeln('no')
                         else writeln('yes');
     end.
    
    • 1

    第三章:if选择结构《练习3:判断一个数的奇偶性》

    Information

    ID
    18525
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By