摘要: for(n=1;n<1000000&&Sn<k;n++) { Sn+=1.0/n; std::cout << "n="<<n<<"Sn="<<Sn<<std::endl;; } //如果输入k=2,判断出去的条件时,n已经等于5了 //但是要的结果是n=4 阅读全文
posted @ 2020-02-01 15:34 韩山剑客 阅读(105) 评论(0) 推荐(0)
摘要: 头文件:#include <climits> 阅读全文
posted @ 2020-02-01 11:13 韩山剑客 阅读(193) 评论(0) 推荐(0)
摘要: 输入的数据可以不用暂时储存,可以随时处理: while(std::cin >> a >> b)// { if(...) break; } 阅读全文
posted @ 2020-01-30 14:12 韩山剑客 阅读(79) 评论(0) 推荐(0)
摘要: 来自:洛谷P1000超级玛丽游戏 https://www.luogu.com.cn/problem/P1000 #include<iostream> int main() { const char* text = R"(Hello\t\n "World"!)"; std::cout <<text; 阅读全文
posted @ 2020-01-30 00:53 韩山剑客 阅读(328) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示