当前位置:网站首页>C language: how to solve the problem of hundreds of horses and loads

C language: how to solve the problem of hundreds of horses and loads

2022-06-24 00:16:00 Nianchi ichthyology programming

#include <stdio.h>
int main()
{
    
	int count=0; 
	for(int i = 0 ; i < 33 ; i++){
    
		for(int j = 0 ; j < 50 ; j++){
    
			for(int k = 0 ; k < 100 ; k++){
    
				if(i+j+k==100 && 3*i+2*j+k/2==100 &&k%2==0){
    
					printf(" Malaysia :%d horse , Zhongma :%d horse , The pony :%d horse \n",i,j,k);
					count++;
				}
			}
		}
	} 
	printf(" share %d Piggyback method !",count);
	return 0;
}
原网站

版权声明
本文为[Nianchi ichthyology programming]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206232150587792.html