题解 | #牛牛的字符菱形#
牛牛的字符菱形
https://www.nowcoder.com/practice/11a5040fa894430f9d25fda1be37ddc8
#include <cstdio> #include <iostream> using namespace std; int main() { char c ; char a[5]={0b00100,0b01110,0b11111,0b01110,0b00100}; scanf("%c",&c); for(int i =0;i<=4;i++){ for(int j =0;j<=4;j++){ if(((a[i]>>j)&0b00001) == 0b00001){ printf("%c",c); } else{ printf(" "); } } printf("\n"); } } // 64 位输出请用 printf("%lld")