C语言代码:

#include <stdio.h>
#include <stdlib.h>
int main()
{
	int m,d;
	
	scanf("%d%d",&m,&d);

	if(m==1&&d>=1&&d<=24)
	{
		printf("Pig");
	}
	else
	{
		printf("Mouse");
	}
	
	return 0;
}


C++代码:

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;

	cin>>a>>b;

	if(a==1&&b<25)   cout<<"Pig";
	else             cout<<"Mouse";

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;

	cin>>a>>b;
	
	if( a==1 && b<25 )
	{
		cout<<"Pig"<<endl;
	}
	else
	{
		cout<<"Mouse"<<endl;
	}
    
    return 0;
}


python3代码:

month,day=input().split()

if(int(month)==1 and int(day)<=24):
    print("Pig")
else :
    print("Mouse")



3112:练19.5 判断生肖(C、C++、python)-LMLPHP3112:练19.5 判断生肖(C、C++、python)-LMLPHP3112:练19.5 判断生肖(C、C++、python)-LMLPHP3112:练19.5 判断生肖(C、C++、python)-LMLPHP3112:练19.5 判断生肖(C、C++、python)-LMLPHP3112:练19.5 判断生肖(C、C++、python)-LMLPHP 




08-18 11:02