博客
关于我
用C语言写藏头诗或藏尾诗
阅读量:308 次
发布时间:2019-03-03

本文共 560 字,大约阅读时间需要 1 分钟。

#include 
#include
int main() { char p[16]; char s[4][20]; int i, len, choice; printf("??????(1)????(2): "); scanf("%d", &choice); for (i = 0; i < 4; i++) { scanf("%s", s[i]); } len = strlen(s[0]); if (choice == 1) { for (i = 0; i < 4; i++) { p[2*i] = s[i][0]; p[2*i + 1] = s[i][1]; } } else { for (i = 0; i < 4; i++) { p[2*i] = s[i][len - 2]; p[2*i + 1] = s[i][len - 1]; } } p[2*i] = '\0'; puts("?????:"); puts(p);}

转载地址:http://pkwm.baihongyu.com/

你可能感兴趣的文章
PYTHON-唤醒+VOSK+DEEPSEEK+离线合成-实现纯离线大模型问答
查看>>
Python-在Dash回调中重用函数
查看>>
PYTHON-基本数据类型-元祖类型,字典类型,集合类型
查看>>
python-外观模式
查看>>
Python-如何使用FastAPI和uvicorn.run而不阻塞线程?
查看>>
Python-字典
查看>>
python-字符串
查看>>
Python-将二进制遮罩转换为多边形
查看>>
python-文件操作
查看>>