Super Resolution

Accepted : 133   Submit : 203
Time Limit : 1000 MS   Memory Limit : 65536 KB 

 

Bobo has an b block of pixels with the same color (see the example for clarity).

Input

The input contains zero or more test cases and is terminated by end-of-file. For each test case,

The first line contains four integers

  • 10

  • The number of tests cases does not exceed 10 .
  • Output

    For each case, output b columns which denote the result.

    Sample Input

    2 2 1 1
    10
    11
    2 2 2 2
    10
    11
    2 2 2 3
    10
    11
    

    Sample Output

    10
    11
    1100
    1100
    1111
    1111
    111000
    111000
    111111
    111111
    

    题意:将n*m的照片放大a*b倍

    解法:模拟

     1 #include<iostream>
     2 #include<vector>
     3 #include<cstring>
     4 #include<cstdio>
     5 
     6 #define  INF 1000000000
     7 
     8 using namespace std;
     9 int x[300][300];
    10 int main()
    11 {
    12     int n,m,a,b;
    13     while(cin>>n>>m>>a>>b)
    14     {
    15         string s[300];
    16         for(int i=0; i<n; i++)
    17         {
    18             cin>>s[i];
    19         }
    20 
    21         for(int i=0; i<n*a; i++)
    22         {
    23             for(int j=0; j<m*b; j++)
    24             {
    25                  cout<<s[i/a][j/b];
    26             }
    27             cout<<endl;
    28         }
    29     }
    30     return 0;
    31 }

     

     

    相关文章:

    • 2021-08-14
    • 2022-12-23
    • 2021-08-28
    • 2022-12-23
    • 2021-08-28
    • 2022-12-23
    • 2022-12-23
    猜你喜欢
    • 2022-12-23
    • 2022-12-23
    • 2022-12-23
    • 2021-06-23
    • 2021-10-12
    • 2022-12-23
    • 2021-12-21
    相关资源
    相似解决方案