标签:return can space div 数据 ring 描述 a* 整数
#include<iostream> #include<string> using namespace std; int main() { int n,m,a; cin>>n>>m>>a; int max1=-1; for(int num=0;num<=999999;num++) { if(a*num <= n ) { if(num>=max1) max1=num; else break; } } int max2=-1; for(int num=0;num<=999999;num++) { if( a*num <= m ) { if(num>=max2) max2=num; else break; } } cout<<max1*max2<<endl; return 0; }
//推荐方法 #include <stdio.h> int main(void) { long n, m, a; scanf("%ld%ld%ld", &n, &m, &a); printf("%ld\n", (n / a) * (m / a)); return 0; }
标签:return can space div 数据 ring 描述 a* 整数
原文地址:https://www.cnblogs.com/fangzheng-nie/p/9921840.html