针对给定问题陈述的C程序 [英] C program for given problem statement

查看:61
本文介绍了针对给定问题陈述的C程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你给出一个正整数N.你必须反转

N的数字。让我们用R表示这个数字。你必须输出N + R.



输入

-----

正整数。



输出

------

整数的倒数和整数的倒数。



样品输入1

--------------

547



样品输出1

---------------

1292



说明

-----------

547的反面是745. 547和745的总和是1292.


我尝试了什么:



plzz尽可能快地回答

You are given a positive integer N. You have to reverse the digits of
N. Let us denote this number by R. You must output N+R.

Input
-----
A positive integer.

Output
------
The sum of the integer and the reverse of the integer.

Sample Input 1
--------------
547

Sample Output 1
---------------
1292

Explanation
-----------
The reverse of 547 is 745. The sum of 547 and 745 is 1292.

What I have tried:

plzz answer it fast as possible

推荐答案

引用:

plzz尽可能快地回答

plzz answer it fast as possible

它没有这样工作。你必须更加努力地解决问题,并在遇到问题时问具体问题



提示:最右边(不太重要)十进制数 N 的数字是(N%10)



(作为替代方案,您可以将数字转换为字符串,反转字符串并将其转换回数字)。

It doesn't work that way. You have to try harder to solve the problem and ask here specific questions whenever you are stuck.

Hint: the rightmost (less significant) digit of the decimal number N is (N%10).

(As an alternative you could convert the number to a string, reverse the string and convert it back to a number).


我们不为您和您编写代码作业,这个论坛适合那些有真正问题的人,不是懒惰的人,甚至不能打扰。
We do not write code for you and your homework, this forum is for people who have genuine problems not people who are lazy and can't be bothered to even try.


我们不做你的家庭作业。

HomeWork不会在乞求其他人做你的工作时测试你的技能,它会让你思考并帮助你的老师检查你对你所学课程的理解以及你在应用它们时遇到的问题。

你的任何失败都会帮助你的老师发现你的弱点并设定补救措施。

你的任何失败都会帮助你了解什么有效,什么无效,被称为'试错'学习。

所以,试一试,重读课程并开始工作。如果您遇到特定问题,请展示您的代码并解释这个问题,我们可能会提供帮助。
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
Any failure of you will help you to learn what works and what don't, it is called 'trial and error' learning.
So, give it a try, reread your lessons and start working. If you are stuck on a specific problem, show your code and explain this exact problem, we might help.


这篇关于针对给定问题陈述的C程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆