#include<iostream> #include<math.h> using·namespace·std; int·main() { ····int·N;int·num1=0,num2=0,num3=0; ····cin>>N; ····if(N<=1000) ····{int·pork=15,chicken=20;double·beef=0.1/9; ····if(N>=pork) ········num1=floor(N/15); ····else·num1=0; ····if(N>=chicken) ········num2=floor(N/20); ····else·num2=0; ····if(N>=beef) ········num3=floor(N/beef); ········else·num3=0; ·cout<<num1<<"·"<<num2<<"·"<<num3; ····} ····return·0; }
标签:num1,num2,num3,int,练习,PTA,else,floor,周二 From: https://www.cnblogs.com/kuandong24/p/17410330.html