Problem E: 求三個字元中的最大值
Problem E: 求三個字元中的最大值
Time Limit: 1 Sec Memory Limit: 128 MB
Description
輸入3個字元,輸出其中的最大值
Input
3個字元
Output
這三個字元中的最大值
Sample Input
a ? Z
Sample Output
a
HINT
參考答案:
#include<stdio.h> int main() { char ch1,ch2; scanf("%c %c",&ch1,&ch2); printf("%c ",(ch1+32)); printf("%c",(ch2-32)); return 0; }
程式設計軟體下載:點選開啟連結
相關推薦
Problem E: 求三個字元中的最大值
Problem E: 求三個字元中的最大值 Time Limit: 1 Sec Memory Limit: 128 MB Description 輸入3個字元,輸出其中的最大值 Input 3個字元 Output 這三個字元中的最
C語言:求10 個整數中最大值
求10 個整數中最大值思路:求10 個整數中最大值,可以利用陣列來完成對10個數的儲存,再用迴圈語句和條件語句來判斷數的大小, 把最大值賦值給最大值變數max,然後輸出最大值。 程式碼如下: #include<stdio.h> int main() { int i,max;
求10 個整數中最大值(c語言)
求10個整數中的最大值(c語言) 思路:1.運用打擂臺的思路進行運算 2.先上去一個數作為擂主,然後依次上去數打擂 3.若打擂失敗,則擂主不變,這個數被淘汰 4.若打擂成功,則擂主被淘汰,打擂者作為新的擂主 5.解決這道題需要使用迴圈語句,讓儲存的10個數依次上
使用三目運算巢狀方法 或 臨時變數方法: 獲取三個整數中最大值的數
package day; import java.util.Scanner; public class Test_11 {// 練習 鍵盤錄入三個整數 比大小 獲取最大值public static void main(String[] args) {Scanner sc =
求10 個整數中最大值。
找出10個數的最大值中心思想是將十個數存入陣列,在進行兩兩比較,找出最大的數存入一個變數中,如果兩個數中最大的數沒有變數中的數大則不改變變數的值,反之則改變變數的值。 #include<stdio.h> #include<stdlib.h
求一個數組中最大值與最小值
div return urn 技術 code include 一個 最小值 array #include <stdio.h> int main() { int array[10]={100,1,40,29,45,22,98,2,83,75};
ZZULIOJ1021: 三個整數的最大值
題目描述 從鍵盤輸入三個整數x,y和z,求出其中最大的數。 輸入 輸入三個整數,用空格隔開。 輸出 輸出最大整數。 樣例輸入 20 16 18 樣例輸出
Python:lambda表示式實現求兩個變數的最大值
lambda 表示式(又稱匿名函式) 作用: 建立一個匿名函式物件 同def 類似,但不提供函式名 格式: lambda [引數1,引數2,.....]: 表示式(預設只能寫一個) 說明: 1.lambda 只是一個表示式,它用
題目:求十個變數的最大值
解題思路:運用一維陣列,將10個變數全部包含在內。然後通過for迴圈,找出最大值。 需要注意要在開頭定格採用巨集變數來忽略VS對scanf函式的警告。 #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> void main(
求一個數組中最大值函式的下標值
#include <stdio.h> int maxElement(array[] ,int n) { int i=0,n=0,t=array[0];//將下標為0的值賦值給t for(i=0;i<n;i++)//控制迴圈 { if(t<ar
[LeetCode] 628. Maximum Product of Three Numbers 三個數字的最大乘積 [LeetCode] 152. Maximum Product Subarray 求最大子陣列乘積 All LeetCode Questions List 題目彙總
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2
求兩個串的最大公共子序列的長度
notes col length body 子字符串 使用遞歸 seq ons commons 1 public class CommonSubsequence { 2 3 public static int f(String s1,String s2){
求數組中最大值
ack 函數 run 記錄 類型 () 字符數 on() span /* 所有c語言代碼,都是在LoadRunner中運行; */ Action(){ int a[]={12,34,565,23,24,667,89,98};//定義一個int數組; int len;
兩個字串中最大相同的子串
求得短的字串和長的字串兩個字串中相同的字串段。 public static String getMaxSubString(String s1, String s2) { String
初學Java:計算陣列中最大值 ---計算陣列中最小值----計算陣列之和----實現兩個陣列----拼接陣列擷取
public class ArrayUtils{ //建立類(陣列工具類) //1.計算陣列中最大值 public static int arrayMaxElement(int [] data){ //建立方法 if(data == null){
編寫程式,獲取兩個字串中最大相同子串
private void test() { String a = "Valaienie"; String b = "Maierginle"; String max = a.length() > b.length() ? a : b; String min =
java中求陣列中最大值
java中陣列中求最大值 public class Max { public static void main(String[] args) { double[] myList = {1.9, 2.9, 3.4, 3.5,10,11,15,100,-1,-4.5
求n個實數去掉最大最小值後的平均值
題目描述 有n個實數,實數的範圍在0—100之間,通過average函式求這n個實數去掉最大最小值後的平均值 要求:n及n個實數在主函式中輸入,結果保留2位小數 分析: 本題只需要注意一下型別就好了。 #include"stdio.h" int main() {
[LeetCode] Maximum Product of Three Numbers 三個數字的最大乘積
Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Input: [1,2,3] Output: 6 Example 2
java求陣列中最大值最小值
通過遍歷陣列來求最大最小值 預設最大值是第一個元素 預設最小值也是第一個元素 這裡有兩種方式來求 一種是記下最大值和最小值 另一種方式是記下最大值最小值在陣列中的下標 輸出的時候再通過下標輸出最大最小