# Topic: There are four digits: 1, 2, 3 and 4. # How many different three digits can be formed without repeating numbers? How much is each? # Procedure analysis: traverse all possibilities and shave out duplicates. total = 0 for i in range(1,5): for
给定一个数列a1,a2,a3,...,an和m个三元组表示的查询,对于每个查询(i,j,k),输出ai,ai+1,...,aj的升序排列中第k个数. #include <iostream> using namespace std; #define SIZE 20 #define M 3 typedef struct Elem { int i, j; int k; } ELEM; /* 表示一个元素的三元组结构 */ int getMedian(int* arr, int low, int hi
Given a string s, partition s such that every substring of the partition is a palindrome Return all possible palindrome partitioning of s. For example, given s = "aab", Return [ ["aa","b"], ["a","a&qu
问题 从键盘输入一个字符串(长度不超过30),统计字符串中非数字的个数,并将统计的结果显示在屏幕上,用EXE格式实现. 源程序 data segment hintinput db "please input a string:$";输入提示语 hintoutput db "non-number:$";输出提示语 str db 30,?,30 dup(?);将输入的字符串保存在str中 crlf db 0ah,0dh,'$';回车换行符 data ends code