标签:pre main clu min can \n while scan ret
#include <stdio.h> int main() { int moves[5]={1,2,3,4,5}; int x; scanf("%d", &x); int ind=4; int Minsteps=0; while((x!=0)&&(ind>=0)) { if(x>=moves[ind]) Minsteps+=x/moves[ind]; x%=moves[ind--]; } printf("%d\n", Minsteps); return 0; }
标签:pre main clu min can \n while scan ret
原文地址:https://www.cnblogs.com/ozxics/p/10678591.html