fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int A,cnt=0,i,j;
  7. cin>>A;
  8. for(i=1;i<=A-1;i++){
  9. if(A%i==0&&(i<=A/i)) {
  10. cnt++;
  11. cout<<"宽="<<i<<"长="<<A/i<<"\n";
  12. }
  13.  
  14. }
  15. cout<<cnt;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5276KB
stdin
600
stdout
宽=1长=600
宽=2长=300
宽=3长=200
宽=4长=150
宽=5长=120
宽=6长=100
宽=8长=75
宽=10长=60
宽=12长=50
宽=15长=40
宽=20长=30
宽=24长=25
12