已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
using System;public class TestNumSort public static void Main() int a, b, c, d; for (a = 1; a = 4; a+) for (b = 1; b = 4;b+ ) for (c=1;c = 4;c+) if (a != b & a != c & b != c)/abc互不相等 d = 10 - a - b - c; if (c = 1 b = 2) & (c = 2 d = 3) & (a = 2 d = 4)/甲乙丙都有一半是正确的 Console.Write(红球放置在0号,黄球放置在1号,, a, b); Console.WriteLine(黑球放置在0号,白球放置在1号,, c, d); Console.Read(); using System;public class TestNumSort public static void Main() int a=1, b=1, c=1, d; while (a = 4) while (b = 4) while (c 1e-10) t1 = t1 * odd / even; odd += 2; even += 2; t2 = 1.0 / odd; t3 = t3 * p; t = t1 * t2 * t3; sum += t; Console.WriteLine(nPI=0,10:f8, sum * 6); Console.Read(); using System;public class TestNumSort public static void Main() double sum = 0.5, t, t1, t2, t3, p = 0.5 * 0.5; int odd = 1, even = 2; t = t1 = t2 = 1.0; t3 = 0.5; do t1 = t1 * odd / even; odd += 2; even += 2; t2 = 1.0 / odd; t3 = t3 * p; t = t1 * t2 * t3; sum += t; while (t 1e-10); Console.WriteLine(nPI=0,10:f8, sum * 6); Console.Read(); using System;public class TestNumSort public static void Main() double sum = 0.5, t, t1, t2, t3, p = 0.5 * 0.5, s; int odd = 1, even = 2; t = t1 = t2 = 1.0; t3 = 0.5; while (t 1e-10) t1 = t1 * odd / even; odd += 2; even += 2; t2 = 1.0 / odd; t3 = t3 * p; t = t1 * t2 * t3; sum += t; Console.Write(请输入圆的半径:); string j = Console.ReadLine(); int r = Convert.ToInt32(j); s = sum * 6 * r * r; Console.WriteLine(nPI=0,10:f8,s=1,10:f8, sum * 6, sum * 6 * r * r); Console.Read(); using System;public class Test6174 public static void Main() Console.Write(请输入一个4位整数); string s = Console.ReadLine(); int num = Convert.ToInt32(s); int each = new int4; int max, min, i, j, temp; while (num != 6174 & num != 0) i = 0; while (num != 0) eachi+ = num%10; num = num / 10; for (i = 0; i 3; i+) for (j = 0; j eachj + 1) temp = eachj; eachj = eachj + 1; eachj + 1 = temp; min = each0 * 1000 + each1 * 100 + each2 * 10 + each3; max = each3 * 1000 + each2 * 100 + each1 * 10 + each0; num = max - min; Console.WriteLine(0-1=2, max, min, num); Console.Read(); using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace test3 class Program public static bool testInput(string s) for (int n = 0; n s.Length; n+) if (!Char.IsNumber(sn) return false; return true; static void Main(string args) Console.Write(请输入一个4位整数:); string s = Console.ReadLine(); while (!testInput(s) Console.WriteLine(输入错误不是整数!请重新输入正确的4位整数); s = Console.ReadLine(); int num = Convert.ToInt32(s); int each = new int4; int max, min, i, j, temp; while (num != 6174 & num != 0) i = 0; while (num != 0) eachi+ = (int)(num * 0.1 - (int)(num * 0.1) * 10); num = num / 10; for (i = 0; i 3; i+) for (j = 0; j eachj + 1) temp = eachj; eachj = eachj + 1; eachj + 1 = temp; min = each0 * 1000 + each1 * 100 + each2 * 10 + each3; max = each3 * 1000 + each2 * 100 + each1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 子宫内膜异位症治疗计划
- 大学野外实训总结
- 新生儿黄疸管理方案
- 药剂科药物安全使用培训方案
- 冷链物流园区规划
- 五级语文彭德怀和他的大黑骡子
- 商业模式画布专题培训课件
- 2020-2025年一级注册建筑师之建筑设计题库与答案
- 2025合同权益的类型范文
- 2025技术合作合同
- 2025年安庆宿松县卫生健康系统部分事业单位公开招聘工作人员14人笔试考试备考题库及答案解析
- 2025-2030老年康复辅具居家适老化改造需求调研报告
- 物业小区电梯故障应急预案
- 2025-2026学年上学期高一英语外研社版期中必刷常考题之语法填空
- 2025年广州公务员行测真题【完整+答案+解析】
- 2025年港澳台联考语文试题及答案解析
- 2026届大湾区普通高中毕业年级联合模拟考试高三语文古诗鉴赏详解:《晚春感事·其四陆游》详注+译文+赏析
- 关于蜥蜴的科普
- 2025年食品安全考试试题(答案+解析)
- 2025年单位开展违规吃喝问题专项整治的工作方案(详细版)
- 配送行业食品安全培训课件
评论
0/150
提交评论