周二(PTA简单题练习)例
#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; }