Solution to a problem P1151

This title is the first time I simulated violence, did not think before. . . . . .

I carefully analyzed what is the optimal solution seemingly simulation. . . . . .

The Code

#include <bits / STDC ++ H.>   // universal header 
the using  namespace STD;
 int main () {
     int K, A, Sub [ . 4 ], F = . 1 ; // F to determine whether no solution 
    cin >> k ;              // read recycled to remake 
    for ( int i = 10000 ; i <= 30000 ; i ++) {    // with i analog a1a2a3a4a5 
        Sub [ . 1 ] = i / 100 ;
        sub[2]=i%10000/10;
        Sub [ . 3 ]% I = 1000 ;      // sub0, SUB1, SUB2 If that 
        IF (Sub [ . 1 ]% K == 0 && Sub [ 2 ]% K == 0 && Sub [ . 3 ]% K == 0 ) {    // If divisible 
            COUT I << << endl;         // output I 
            F = 0 ;                 // solvable 
        }
    }
    IF (F)    // If no solution 
        COUT << " No " ;    // Output No 
    return  0 ;      // perfect end 
}
```

The first written solution to a problem, please point a praise. . .

Guess you like

Origin www.cnblogs.com/win10crz/p/12320920.html