微軟手機的訊號顯示

來源:互聯網
上載者:User

標籤:esc   ext   網路   模式   style   height   contest   test   code   

微軟手機的訊號顯示

微軟近日推出了一款功能極簡的手機,在手機上用一個包含了 7×77 \times 77×7 個像素的地區來顯示手機訊號。滿訊號的時候顯示如下:

 

每一格訊號(第 i(1≤i≤5)i(1 \le i \le 5)i(1≤i≤5) 格訊號有 iii 個-)代表 20%20\%20% 的訊號強度,不足一格訊號的部分不顯示。同時會在右上方顯示當前的網路傳輸模式。在訊號強度不低於 90%90\%90% 的時候顯示4G;當訊號低於 90%90\%90%、不低於 60%60\%60% 的時候顯示3G;否則顯示E

對於給定的當前訊號強度 d%d\%d%,輸出訊號的 7×77 \times 77×7 像素的圖案。

輸入格式

輸入一個整數 d(0≤d≤100)d(0 \le d \le 100)d(0≤d≤100),表示訊號強度。

輸出格式

按照題目要求輸出,每行末尾不要輸出多餘的空白字元。

範例輸入1
0
範例輸出1
+-----+|    E||     ||     ||     ||     |+-----+
範例輸入2
65
範例輸出2
+-----+|-  3G||--   ||---  ||     ||     |+-----+

直接6個if就可以了。
 1 #include <bits/stdc++.h> 2 using namespace std; 3 int main(){ 4     int d; 5     cin>>d; 6     if(d < 20){ 7         cout << "+-----+\n|    E|\n|     |\n|     |\n|     |\n|     |\n+-----+\n" << endl; 8     }else if(d < 40){ 9         cout << "+-----+\n|-   E|\n|     |\n|     |\n|     |\n|     |\n+-----+\n"<< endl;10     }else if(d < 60){11         cout << "+-----+\n|-   E|\n|--   |\n|     |\n|     |\n|     |\n+-----+\n"<< endl;12     }else if(d < 80){13         cout << "+-----+\n|-  3G|\n|--   |\n|---  |\n|     |\n|     |\n+-----+\n"<< endl;14     }else if(d < 90){15         cout << "+-----+\n|-  3G|\n|--   |\n|---  |\n|---- |\n|     |\n+-----+\n"<< endl;16     }else if(d < 100){17         cout << "+-----+\n|-  4G|\n|--   |\n|---  |\n|---- |\n|     |\n+-----+\n"<< endl;18     }else if(d == 100){19         cout << "+-----+\n|-  4G|\n|--   |\n|---  |\n|---- |\n|-----|\n+-----+\n"<< endl;20     }21     return 0;22 }

 

微軟手機的訊號顯示

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.