两个整数之和 [英] sum of two integers

查看:108
本文介绍了两个整数之和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

我有一个令我困惑的问题

它是以下内容:


编写C ++程序在不使用任何算法,循环,递归的情况下找到两个整数的总和。

Hi everybody
I have a problem which is puzzling me
it is the following:

Write a C++ program to find the sum of two integers without using any
arithmetic, loops, recursions nothing.

推荐答案

robin写道:
robin wrote:

我有一个令我困惑的问题

它是以下:


编写一个C ++程序来查找两个整数的总和,而不使用任何

算术,循环,递归。
I have a problem which is puzzling me
it is the following:

Write a C++ program to find the sum of two integers without using any
arithmetic, loops, recursions nothing.



#include< iostream>

int main(){

std :: cout<< ; 输入两个整数 << std :: flush;

int a,b;

std :: cin> a> b;

std :: cout< ;< 现在输入他们的金额,否则我会告诉妈妈! " << std :: flush;

int sum;

std :: cin> sum;

std :: cout<< 总和 << a<< "和 << b<< "是 <<总和;

std :: cout<< std :: endl;

}


V

-

请删除资金''当用电子邮件回复时,我会回答这个问题吗?我没有回复最热门的回复,请不要问

#include <iostream>
int main() {
std::cout << "Enter two integers " << std::flush;
int a, b;
std::cin >a >b;
std::cout << "Now enter their sum or I''ll tell mom! " << std::flush;
int sum;
std::cin >sum;
std::cout << "The sum of " << a << " and " << b << " is " << sum;
std::cout << std::endl;
}

V
--
Please remove capital ''A''s when replying by e-mail
I do not respond to top-posted replies, please don''t ask


robin写道:
robin wrote:

大家好

我有一个令我困惑的问题

它是以下:


编写一个C ++程序来查找两个整数的总和,而不使用任何

算术,循环,递归。
Hi everybody
I have a problem which is puzzling me
it is the following:

Write a C++ program to find the sum of two integers without using any
arithmetic, loops, recursions nothing.



今天早些时候,comp.lang.c也让你感到困惑。你在那里得到了

刷新,所以你以为你会在这里试试?


1.选择一种语言。


2.做自己的作业。


Brian

It puzzled you on comp.lang.c as well, earlier today. You got the
brushoff there, so you thought you''d try here?

1. Pick a language.

2. Do your own homework.

Brian


robin写道:
robin wrote:

大家好

我有一个令我困惑的问题

如下:


编写一个C ++程序来查找两个整数的总和,而不使用任何

算术,循环,任何递归。
Hi everybody
I have a problem which is puzzling me
it is the following:

Write a C++ program to find the sum of two integers without using any
arithmetic, loops, recursions nothing.



cout<< ; 1 + 1 = 2 \ n;

cout << "1 + 1 = 2\n";


这篇关于两个整数之和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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