
1009 说反话 (PAT)
��������������������� ��������������������������������������������� ������������������������������ ������������������������
发布日期:2021-05-10 14:39:53
浏览次数:15
分类:精选文章
本文共 1545 字,大约阅读时间需要 5 分钟。
������������������������C������������������������������������������������������������������
#include#include #include int main() { char str[100]; int s, p, e, j, i; gets(str); s = strlen(str); p = s; // ������������������������������words��� char *words = malloc(p * sizeof(char)); words[0] = '\0'; int word_count = 0; for (i = s - 1; i >= 0; i--) { if (str[i] == ' ') { if (word_count > 0) { words[word_count] = '\0'; word_count++; } j = i + 1; while (j < s && str[j] != ' ') { j++; } for (k = 0; k < j - i - 1; k++) { words[word_count + k] = str[i + 1 + k]; } words[word_count] = '\0'; word_count++; } else { // ������������������������������������������ if (i > p) { // ������������������������������ // (������������������������������������������������������������������������) } } } if (word_count > 0) { // ��������������������� printf("%s", words); } free(words); return 0;}
���������������������������������
������������������������������������������������������������������������������������������������������������
发表评论
最新留言
哈哈,博客排版真的漂亮呢~
[***.90.31.176]2025年04月26日 13时25分56秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
Java容器(Map、Set、List)
2021-05-11
排序算法(一)堆排序
2021-05-11
(进)函数super用法
2021-05-11
Vue实现文本框自动获取焦点
2021-05-11
主流的基于SpringBoot的后台管理系统
2021-05-11
基于SpringBoot+MyBatisPlus实现一套后台开发框架
2021-05-11
JavaWeb高效的后台开发
2021-05-11
SpringBoot+Thymeleaf多模块后台开发框架
2021-05-11
javaweb后台开发框架
2021-05-11
基于Laravel5.8开发的高性能后台开发框架
2021-05-11
SpringCloud使用Gateway构建微服务网关
2021-05-11
SpringBoot+Vue+ElementUI低代码前后端分离后台管理系统
2021-05-11
基于Laravel8.x+Vue+AntDesign社会团购后台管理系统源码
2021-05-11
springboot(9)——员工管理系统之登录功能的实现
2021-05-11
请你谈谈Redis主从复制的理解?
2021-05-11
请你谈谈Redis缓存穿透和雪崩?
2021-05-11
请你谈谈http状态码、http 请求包含哪几个部分?
2021-05-11