程序列表 | 编程示例2025年3月8日 | 阅读 29 分钟 以下是 C、C++、Java、C#、Python 和 PHP 的程序或编程示例列表。 基础程序![]() 输入
输出 Area of Rectangle = Width * Height = 10 * 5 = 50 ![]() 输入
输出 Volume = (4.0/3.0) * pie * (radius * radius * radius); = (4.0/3.0) * 3.14 * 48 * 48 * 48 = 463433.132812 ![]() 输入
输出 Area of Pentagon = (5.0/2.0) * s * a = (5.0/2.0) * 13 * 5 = 162.5 ![]() 输入
输出 Area of Parallelogram = base * height; = 4 * 18 = 72 ![]() 输入
输出 Area of Square = a2 = 132 = 169 ![]() 输入
输出 Volume = 4 * pie * (radius * radius); = 4 * 3.14 * 37 * 37 = 17210.285714 ![]() 输入
输出 Volume = pie * radius * radius * height/3; = 3.14 * 38 * 38 * 35/3 = 48766.666667 ![]() 输入
输出 Volume of cube = side3 = 43 = 64 ![]() 输入
输出 Volume of the cylinder = pie * radius2 * height = 3.14 * 38* 38 * 35 = 146300.000000 CGPA 百分比是 = (float)(9.5 * (CGPA)); 输入
输出 CGPA percentage is = 86.070000 华氏温度 = ((摄氏度 * 9) / 5) + 32 输入
输出 Temperature in Fahrenheit = 53.6 输入
输出 Number of years = days / 365; = 799 / 365 = 2 摄氏温度 = ((华氏度-32)*5)/9 输入
输出 Temperature in Celsius= ((54-32)*5)/9 = 12.22222 ![]() 输入
输出 Area of Equilateral Triangle = ( 1.73 * a * a) / 4 = ( 1.73 * 5 * 5) / 4 = 10.81250 ![]() 输入
输出 Area of Triangle = (b * h) / 2 = (5 * 12) / 2 = 30.0 ![]() 输入
输出 Area of Triangle = (b * h) / 2 = (5 * 8) / 2 = 20.0 ![]() 输入
输出 Perimeter of Rectangle = 2 * ( a + b); = 2 * (5 + 4) = 18.00000 单利息 = (P × R × T) / 100 输入
输出 Simple Interest = 51000.000 ![]() 立方体表面积 = 6 ( a * a ) 输入
输出 Surface Area Of Cube = 6 * 5 * 5=150.00000 ![]() 输入
输出 Surface Area OfCuboid = 2 * (l * w+ w * h + h * l) = 2 * (2 * 3 + 3 * 5 + 5 * 2) = 62.00000 ![]() 圆柱体表面积 = 2 Π (r + h) 输入
输出 Surface Area of Cylinder = 2 Π (r + h) Here, r = radius, h = height, and Π ( pie ) = 3.14 = 2 * 3.14 * ( 2.0 + 5.0) = 44.00000 数字程序输入
输出 11 + 72 + 53 = 1 + 49 + 125 = 175 175 is a disarium number 输入
输出 82 + 22 = 68 62 + 82 = 100 12 + 02 + 02 = 1 82 is a happy number number 如果一个数能被其各位数字之和整除,则称该数为哈沙德数。 输入
输出 156 is a Harshad number 4) 打印 1 到 100 之间的所有迪沙里数(Disarium number)的程序 输入
输出 Disarium numbers between 1 and 100 are: 1 2 3 4 5 6 7 8 9 89 5) 打印 1 到 100 之间的所有快乐数(Happy number)的程序 输入
输出 List of happy numbers between 1 and 100: 1 7 10 13 19 23 28 31 32 44 49 68 70 79 82 86 91 94 97 100 6) 打印 1 到 100 之间的所有普罗尼克数(Pronic number)的程序 如果一个数是两个连续整数的乘积,则称该数为普罗尼克数。 例如 6 = 2 x 3 输入
输出 Pronic numbers between 1 and 100: 2 6 12 20 30 42 56 72 90 7) 确定给定数字是否为亏数(Deficient number)的程序 8) 确定给定数字是否为丰数(Abundant number)的程序 9) 确定给定数字是否为扭素数(Twisted prime number)的程序 10) 打印 1 到 100 之间的所有丰数(Abundant number)的程序 11) 打印 1 到 100 之间的所有卡普雷卡数(Kaprekar number)的程序 12) 打印 1 到 100 之间的所有素数(Prime number)的程序 15) 打印前 10 个素数(Prime number)的程序 数组程序输入
输出 Elements of original array: 1 2 3 4 5 Elements of new array: 1 2 3 4 5 输入
输出 Element | Frequency 1|2 2|4 8|1 3|1 5|1 输入
输出 Original array: 1 2 3 4 5 Array after left rotation: 4 5 1 2 3 输入
输出 Duplicate elements in given array: 2 3 8 输入
输出 Elements of given array: 1 2 3 4 5 输入
输出 Original array: 1 2 3 4 5 Array in reverse order: 5 4 3 2 1 输入
输出 Elements of given array present on even position: 2 4 输入
输出 Elements of given array present on odd position: 1 3 5 输入
输出 Largest element present in given array: 75 输入
输出 Number of elements present in given array: 5 输入
输出 Smallest element present in given array: 7 输入
输出 Sum of all the elements of an array: 15 输入
输出 Original array: 1 2 3 4 5 Array after right rotation: 3 4 5 1 2 输入
输出 Elements of original array: 5 2 8 7 1 Elements of array sorted in ascending order: 1 2 5 7 8 输入
输出 Elements of original array: 5 2 8 7 1 Elements of array sorted in descending order: 8 7 5 2 1 矩阵程序输入
输出 Addition of two matrices: [2 1 2] [6 8 7] [2 7 4] 输入
输出 Subtraction of two matrices: [2 5 3] [1 1 0] [0 1 2] 输入
输出 Given matrix is an identity matrix 输入
输出 Given matrix is a sparse matrix 输入
输出 Matrices are equal 输入
输出 Lower triangular matrix: [1 0 0] [8 6 0] [4 5 6] 输入
输出 Upper triangular matrix: [1 2 3] [0 6 4] [0 0 6] 输入
输出 Frequency of odd numbers: 5 Frequency of even numbers: 4 ![]() 输入
输出 Product of two matrices: [7 7 6] [8 6 5] [6 7 5] ![]() 输入
输出 Sum of 1 row: 6 Sum of 2 row: 15 Sum of 3 row: 24 Sum of 1 column: 12 Sum of 2 column: 15 Sum of 3 column: 18 输入
输出 Transpose of given matrix: [1 4 7] [2 5 8] [3 6 9] 字符串程序输入
输出 如果字符串中的任何字符与('!', "," ,"\'" ,";" ,"\"", ".", "-" ,"?") 匹配,则计数加 1。 Total number of punctuation characters exists in string: 4 输入
输出 vowels = a, e, i, o, u consonants = b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z 输入 如果两个字符串包含相同的字符,则它们被称为变位词。但是,字符的顺序或序列可能不同。 str1 = "Grab"; str2 = "Brag"; 输出 Both the strings are anagram. 输入
输出 Equal parts of given string are aaaa bbbb cccc 输入
输出 All the permutations of the string are: ABC ACB BAC BCA CBA CAB 输入
输出 All subsets for given string are: A AB ABC B BC C 输入
输出 Longest repeating sequence: bdf 输入
输出 String after removing all the white spaces : Removewhitespaces 输入
输出 String after case conversion : gREAT pOWER 输入
输出 String after replacing spaces with given character: Once-in-a-blue-moon 输入
输出 Total number of characters in a string: 19 输入
输出 Total number of words in the given string: 7 输入
输出 Given string is palindrome. 输入
输出 Second string is a rotation of first string. 输入
输出 Minimum occurring character: a Maximum occurring character: e 输入
输出 Original string: Dream big Reverse of given string: gib maerD 输入
输出 Duplicate characters in a given string: r e t s i 输入
输出 Duplicate words in a given string: big black 输入
输出 Characters and their corresponding frequencies p-2 i-1 c-2 t-2 u-1 r-2 e-3 f-1 输入
输出 Smallest word: an Largest word: extraordinary 输入
data.txt 文件内容 “计算机”一词源自拉丁语“computare”,意为计算。计算机是一种可编程的电子设备。计算机接受原始数据作为输入,并使用一组指令对其进行处理以产生结果作为输出。计算机的历史始于算盘的诞生,算盘被认为是第一台计算机。 输出 Most repeated word: computer 输入
data.txt 文件内容 “计算机”一词源自拉丁语“computare”,意为计算。计算机是一种可编程的电子设备。计算机接受原始数据作为输入,并使用一组指令对其进行处理以产生结果作为输出。计算机的历史始于算盘的诞生,算盘被认为是第一台计算机。 输出 Number of words present in given file: 117 输入
输出 Smallest palindromic word: wow Biggest palindromic word: kayak 输入
输出 Individual characters from given string: characters 输入
输出 Strings before swapping: Good morning Strings after swapping: morning Good 图案程序![]() 5432* *000*000* 1 ![]() ![]() 12344321 ![]() 0 ![]() A ![]() 1 2 3 4 5 ![]() ![]() ![]() 1 1 ![]() 树程序输入 ![]() 输出 OddLevelSum = 1 + 4 + 5 + 6 = 16 EvenLevelSum = 2 + 3 = 5 Difference = |16 - 5| = 11 输入 ![]() 输出 Binary search tree after insertion: 10 30 50 60 70 90 Binary search tree after deleting node 90: 10 30 50 60 70 Binary search tree after deleting node 30: 10 50 60 70 Binary search tree after deleting node 50: 10 60 70 输入 ![]() 输出 Inorder representation of binary tree: 4 2 5 1 6 3 7 Inorder representation of resulting binary search tree: 1 2 3 4 5 6 7 输入 ![]() 输出 All leaves are at same level 输入 ![]() 输出 Both the binary trees are identical 输入 ![]() 输出 Maximum width of the binary tree: 4 输入 ![]() 输出 Largest element in the binary tree: 74 输入 ![]() 输出 Maximum height of given binary tree: 5 输入 ![]() 输出 Nodes which are at maximum distance: ( 4,9 ) ( 5,9 ) 输入 ![]() 输出 Smallest element in the binary tree: 1 输入 ![]() 输出 Sum of all nodes of binary tree: 31 输入 ![]() 输出 Total number of possible Binary Search Trees with given key: 42 输入 ![]() 输出 Binary tree after insertion: 1 Binary tree after insertion: 2 1 3 Binary tree after insertion: 4 2 5 1 3 Binary tree after insertion: 4 2 5 1 6 3 7 输入 在二叉树中搜索节点 5 ![]() 输出 Element is present in the binary tree 单向链表程序输入
输出 100 200 300 输入
输出 Nodes of singly linked list: 1 2 3 4 输入
输出 Nodes of singly linked list: 1 2 3 4 Count of nodes present in the list: 4 输入
输出 Original List: 1 2 3 4 Reversed List: 4 3 2 1 输入
输出 Original List: 1 2 3 4 Updated List: 2 3 4 Updated List: 3 4 Updated List: 4 Updated List: List is empty 输入
输出 Original List: 1 2 3 4 Updated List: 1 3 4 Updated List: 1 4 Updated List: 4 Updated List: List is empty 输入
输出 Original List: 1 2 3 4 Updated List: 1 2 3 Updated List: 1 2 Updated List: 1 Updated List: List is empty 输入
输出 Nodes of the singly linked list: 1 2 3 2 1 Given singly linked list is a palindrome 输入
输出 Minimum value node in the list: 1 Maximum value node in the list: 8 输入
输出 Original list: 1 2 Updated List: 1 3 2 Updated List: 1 3 4 2 输入
输出 Adding nodes to the start of the list: 1 Adding nodes to the start of the list: 2 1 Adding nodes to the start of the list: 3 2 1 Adding nodes to the start of the list: 4 3 2 1 输入
输出 Adding nodes to the end of the list: 1 Adding nodes to the end of the list: 1 2 Adding nodes to the end of the list: 1 2 3 Adding nodes to the end of the list: 1 2 3 4 输入
输出 Originals list: 1 2 3 2 2 4 1 List after removing duplicates: 1 2 3 4 输入
输出 Element is present in the list at the position : 2 Element is not present in the list 输入
输出 Original list: 9 7 2 5 4 Sorted list: 2 4 5 7 9 输入
输出 Original list: 1 2 3 4 5 List after swapping nodes: 1 5 3 4 2 输入
输出 Originals list: 1 2 3 4 List after swapping the first node with last: 4 2 3 1 循环链表程序输入
输出 Count of nodes present in circular linked list: 6 输入
输出 Original List: 1 2 3 4 5 6 Reversed List: 6 5 4 3 2 1 输入
输出 Nodes of the circular linked list: 1 2 3 4 输入
输出 Original List:1 2 3 4 Updated List:2 3 4 Updated List:3 4 Updated List:4 Updated List: List is empty 输入
输出 Original List:1 2 3 4 Updated List:1 2 3 Updated List:1 2 Updated List:1 Updated List: List is empty 输入
输出 Original List:1 2 3 4 Updated List:1 3 4 Updated List:1 4 Updated List:4 Updated List: List is empty 输入
输出 Minimum value node in the list: 1 Maximum value node in the list: 20 输入
输出 Adding nodes to the start of the list: 1 Adding nodes to the start of the list: 2 1 Adding nodes to the start of the list: 3 2 1 Adding nodes to the start of the list: 4 3 2 1 输入
输出 Adding nodes to the end of the list: 1 Adding nodes to the end of the list: 1 2 Adding nodes to the end of the list: 1 2 3 Adding nodes to the end of the list: 1 2 3 4 输入
输出 Original list: 1 2 3 4 Updated List: 1 2 5 3 4 Updated List: 1 2 5 6 3 4 输入
输出 Originals list:1 2 3 2 2 4 List after removing duplicates:1 2 3 4 输入
输出 Element is present in the list at the position : 2 Element is not present in the list 输入
输出 Original list:70 90 20 100 50 Sorted list:20 50 70 90 100 双向链表程序输入
输出 Nodes of generated doubly linked list: 4 2 5 1 6 3 7 输入
输出 Nodes of the generated doubly linked list: 5 10 20 40 50 12 24 36 48 15 30 45 60 输入
输出 Nodes of doubly linked list: 1 2 3 4 5 Count of nodes present in the list: 5 输入
输出 Original List: 1 2 3 4 5 Reversed List: 5 4 3 2 1 输入
输出 Nodes of doubly linked list: 1 2 3 4 5 输入
输出 Original List: 1 2 3 4 5 Updated List: 2 3 4 5 Updated List: 3 4 5 Updated List: 4 5 Updated List: 5 Updated List: List is empty 输入
输出 Original List: 1 2 3 4 5 Updated List: 1 2 3 4 Updated List: 1 2 3 Updated List: 1 2 Updated List: 1 Updated List: List is empty 输入
输出 Original List: 1 2 3 4 5 Updated List: 1 2 4 5 Updated List: 1 4 5 Updated List: 1 5 Updated List: 5 Updated List: List is empty 输入
输出 Minimum value node in the list: 1 Maximum value node in the list: 9 输入
输出 Adding a node to the start of the list: 1 Adding a node to the start of the list: 2 1 Adding a node to the start of the list: 3 2 1 Adding a node to the start of the list: 4 3 2 1 Adding a node to the start of the list: 5 4 3 2 1 输入
输出 Adding a node to the end of the list: 1 Adding a node to the end of the list: 1 2 Adding a node to the end of the list: 1 2 3 Adding a node to the end of the list: 1 2 3 4 Adding a node to the end of the list: 1 2 3 4 5 输入
输出 Original list: 1 2 Updated List: 1 3 2 Updated List: 1 3 4 2 Updated List: 1 3 5 4 2 输入
输出 Originals list: 1 2 3 2 2 4 5 3 List after removing duplicates: 1 2 3 4 5 输入
输出 Original List: 1 2 3 4 5 Updated List: 4 5 1 2 3 输入
输出 Node is present in the list at the position : 3 Node is not present in the list 输入
输出 Original list: 7 1 4 5 2 Sorted list: 1 2 4 5 7 杂项编写查找五棱柱(Pentagonal Prism)表面积的程序 编写查找长方体(Rectangular Prism)面积的程序 编写查找三棱柱(Triangular Prism)表面积的程序 编写查找长方体(Rectangular Prism)体积的程序 |
我们请求您订阅我们的新闻通讯以获取最新更新。