static void Main(){ //输入三个数求最大值. string answar = "y"; while (answar=="y"||answar=="Y") { int x,y,z,max; Console.WriteLine("请输入第一个数:"); x = int.Parse(C ...
分类:
其他好文 时间:
2019-06-03 12:31:02
阅读次数:
81
/** 返回两个整型变量数据的较大值 */ public static int max(int num1, int num2) { int result; if (num1 > num2) result = num1; else result = num2; return result; } pub... ...
分类:
编程语言 时间:
2019-06-02 15:38:25
阅读次数:
101
/*最大公约数求解*/#include "stdafx.h"#include <stdio.h>int main(){ int max(int,int); int a,b; printf("Please input your numbers\n"); scanf("%d,%d\n",&a,&b); ...
分类:
编程语言 时间:
2019-05-18 00:44:36
阅读次数:
103
题目描述如下: 能立刻想到的就是爆破,先试试无脑爆破,时间复杂度O(n^3),然后毫无意外的超时了,爆破代码如下: public String longestPalindrome(String s) { int max = 0; int length = s.length(); // 字符串长度只有 ...
分类:
其他好文 时间:
2019-04-28 19:11:58
阅读次数:
149
public String longestPalindrome(String s) { if(s == null||s.length()==0){ return s; } String res = ""; int max=0; boolean[][] dp = new boolean[s.l... ...
分类:
其他好文 时间:
2019-04-24 23:28:12
阅读次数:
583
static void Main(string[] args) { int a = 10; //数组长度 int b = 0; //小数位数 int min = 5; //最小数 int max = 20; //最大数 decimal[... ...
分类:
编程语言 时间:
2019-04-19 19:41:03
阅读次数:
163
1 /** 2 * 01 3 * 描述:求int数组中最大值 4 * 【时间 2019年3月5日下午3:21:36 作者 陶攀峰】 5 */ 6 public static int test01(int[]sz) { 7 int max = sz[0]; 8 for(int x=1; x<sz.le ...
分类:
编程语言 时间:
2019-04-18 17:21:29
阅读次数:
155
代码 include using namespace std; define MAX_N 100 int bit[MAX_N + 1], n; long long f; int a[MAX_N]; int sum(int i){ int s = 0; while(i 0){ s += bit[i]; ...
分类:
编程语言 时间:
2019-04-16 14:24:13
阅读次数:
164
#include using namespace std; struct Stu { int score; string id, num; }stu; int main(){ string s1 ,s2 , s3, s4; int n, max = 0, min = 110; cin >> n; w... ...
分类:
其他好文 时间:
2019-04-16 01:05:02
阅读次数:
185