斐波那契... [英] Fibonacci...
问题描述
我真的很尴尬地问这个问题...
@code start
#include< iostream>
int main(){
unsigned long long a = 1;
unsigned long long b = 1;
for(int i = 0 ; i< 45; i ++){
a + = b;
std :: cout<< a / b<< std :: endl;
b + = a;
std :: cout<< b / a<< std :: endl;
}
std :: cin.get();
}
@code结束
为什么我不能上班?
问候
Zacariaz
>
Im actually kinda embarassed to ask this question...
@code start
#include <iostream>
int main() {
unsigned long long a = 1;
unsigned long long b = 1;
for (int i = 0; i < 45; i++) {
a += b;
std::cout << a/b << std::endl;
b += a;
std::cout << b/a << std::endl;
}
std::cin.get();
}
@code end
Why cant i get it to work?
Regards
Zacariaz
推荐答案
猜猜这会更正确:
@code start
#include < iostream>
int main(){
unsigned long long a = 1;
unsigned long long b = 1;
std :: cout<< b / a<< std :: endl;
for(int i = 0; i< 91; i ++){
if(a> b){
b + = a;
std :: cout<< b / a<< std :: endl;
}
else if(b> = a){
a + = b;
std :: cout<< a / b<< std :: endl;
}
}
std :: cin.get();
}
@code结束
Guess this would be more correct:
@code start
#include <iostream>
int main() {
unsigned long long a = 1;
unsigned long long b = 1;
std::cout << b/a << std::endl;
for (int i = 0; i < 91; i++) {
if (a > b) {
b += a;
std::cout << b/a << std::endl;
}
else if (b >= a) {
a += b;
std::cout << a/b << std::endl;
}
}
std::cin.get();
}
@code end
fe ********** @ hotmail.com 写道:
我真的有点尴尬地问这个问题......
> @code start
#include< iostream>
int main(){
unsigned long long a = 1;
unsigned long long b = 1;
for (int i = 0; i< 45; i ++){
a + = b;
std :: cout<< a / b<< std :: endl;
b + = a;
std :: cout<< b / a<< std :: endl;
}
std :: cin.get();
}
@code end
为什么我无法上班?
Im actually kinda embarassed to ask this question...
@code start
#include <iostream>
int main() {
unsigned long long a = 1;
unsigned long long b = 1;
for (int i = 0; i < 45; i++) {
a += b;
std::cout << a/b << std::endl;
b += a;
std::cout << b/a << std::endl;
}
std::cin.get();
}
@code end
Why cant i get it to work?
你真的想知道答案吗?我的意思是,你真的不知道吗?b $ b已经知道答案了吗?
你对你的计划有什么期望?似乎有什么问题?
V
-
请在邮寄回复时从我的地址中删除资金
Do you really want to know the answer? I mean, don''t you actually
already know the answer?..
What do you expect from your program? What seems to be the problem?
V
--
Please remove capital As from my address when replying by mail
fe ********** @ hotmail.com 写道:
猜猜这会更正确:
更正确?你的意思是,它实际上做你需要的?或者
只是_seem_会更好吗?
@code start
#include< iostream>
int main(){
unsigned long long a = 1;
unsigned long long b = 1;
std :: cout<< b / a<< std :: endl;
for(int i = 0; i< 91; i ++){
if(a> b){
b + = a;
std :: cout<< b / a<< std :: endl;
}
如果(b> = a){
a + = b;
std :: cout<< a / b<< std :: endl;
}
}
std :: cin.get();
}
@code end
Guess this would be more correct:
"More correct"? You mean, it actually does what you need? Or
does it just _seem_ to be better?
@code start
#include <iostream>
int main() {
unsigned long long a = 1;
unsigned long long b = 1;
std::cout << b/a << std::endl;
for (int i = 0; i < 91; i++) {
if (a > b) {
b += a;
std::cout << b/a << std::endl;
}
else if (b >= a) {
a += b;
std::cout << a/b << std::endl;
}
}
std::cin.get();
}
@code end
V
-
请在邮寄回复时从我的地址中删除资金
V
--
Please remove capital As from my address when replying by mail
这篇关于斐波那契...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!