用c语言编辑文字“晴天”
发布网友
发布时间:2024-10-23 22:20
我来回答
共3个回答
热心网友
时间:2024-10-29 23:32
你好!!
编辑汉字,那就采用点阵字库的方式,读取出点阵
热心网友
时间:2024-10-29 23:29
可以用二维数组,双重循环进行编写啊!
热心网友
时间:2024-10-29 23:28
#include<iostream>
using namespace std;
int main(){
int i,j;
int a[16][16]=
{0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,
0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,
0,1,0,0,1,0,1,1,1,1,1,1,1,0,0,0,
0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,
0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,
0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,
0,1,0,0,1,0,1,1,1,1,1,1,1,1,0,0,
0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,
0,1,0,0,1,0,1,1,1,1,1,1,1,0,0,0,
0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,
0,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,
0,1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,
0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,
0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,};
int b[16][16]=
{0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,1,0,1,0,0,0,0,0,0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