A. 【例题1】数字反转
2024-09-05 06:32:36
题目解析
字符串的基础操作,注意判断零即可
#include <bits/stdc++.h>
using namespace std; int i;
char c[15]; int main ()
{
scanf ("%s", &c);
if (c[0] == '-')
{
i = 1;
printf ("-");
}
for (int j = strlen (c) - 1; j >= i; -- j)
{
if (c[j] - 48 != 0)
printf ("%c", c[j]);
}
return 0;
}
最新文章
- Qt5中的信号槽
- H5实现俄罗斯方块(三)
- DDD:谈谈数据模型、领域模型、视图模型和命令模型
- R 语言实现牛顿下降法
- Git hub pull时候的错误 : The current branch is not configured for pull No value for key branch.master.merge found in configuration
- Linux中tar命令-C用法
- EF操作sqlite数据库时的项目兼容性问题
- 关闭sublime自动检测更新提示
- python-面向对象入门
- ionic3 隐藏子页面tabs
- python之运算符与基本数据类型
- 测试SD卡读写速度
- Access restriction: The type BASE64Encoder is not accessible due to restriction on required library C:\Program Files\Java\jre6\lib\rt.jar
- Cognos11中关于CJAP第三方认证的相关配置
- PinnedListView分析一
- js面试题——找到数组中的重复元素并判断重复次数且输出重复元素
- stm32 Flash读写[库函数]
- SQL中禁用trigger
- SGU 126	Boxes(模拟题|二进制)
- Android Hook框架Xposed详解