计算机科学与技术152 (青海大学)

  • 软件工程——爬楼梯

    #include "stdafx.h"#include<iostream>using namespace std; int _tmain(int argc, _TCHAR* argv[]){ int i=1,j,m; cout<<"输入台阶数:"; cin>>m; int A[10]; A[0]=1
    Gali-gaygay   2017-03-07 21:38   0   174
  • 软件工程---删除重复数组

    删除重复数组 #include "stdafx.h"#include<iostream>using namespace std; int _tmain(int argc, _TCHAR* argv[]){ int i,j,k; int length; cout<<"输入数组长度:"; cin>>le
    Gali-gaygay   2017-03-07 21:36   0   156
  • 软件工程实验一实验报告

    《面向对象方法及软件工程》实验报告 姓名:潘玖庆 学号:1500802062 班级: 152 时间:2017-3-4 1.实验题目:题目1:删除排序数组中的重复数字 2.问题描述:在给定的一序列数组中,删除重复的元素,并输出新的无重复的数组序列 3.数据输入:在键盘输入数组元素,如5 1 3 2 3
    Gali-gaygay   2017-03-07 18:03   0   253
  • 买卖股票的最佳时机 - C++

    if(prices.empty()) return 0 ; int max = 0; /* 定义最大利润 */ int min = prices[0]; for(int i = 1 ; i < prices.size() ; i++ ) { if(prices[i] < min) min = pri
    tong-joker   2017-03-06 23:31   0   440
  • 删除排序数组中的重复数字

    if(nums.empty()) return 0 ; int len = nums.size(); int a = 1 ; for(int i=1;i<len;i++) { if(nums[i]!=nums[a-1]) { nums[a++] = nums[i]; } } return a;
    tong-joker   2017-03-06 23:29   0   108
  • 爬楼梯

    public class Solution { /** * @param n: An integer * @return: An integer */ public int climbStairs(int a) { if(a == 0){ return 1; } ...
    仙人掌111   2017-03-06 23:21   0   3
  • 买卖股票的最佳时机

    public class Solution { /** * @param prices: Given an integer array * @return: Maximum profit */ public int maxProfit(int[] prices) { // write your code here i...
    仙人掌111   2017-03-06 23:20   0   4
  • 删除排序数组中的重复数字

    class Solution { public: /** * @param A: a list of integers * @return : return an integer */ int removeDuplicates(vector &nums) { if(nums.empty()) { ...
    仙人掌111   2017-03-06 23:16   0   2
  • 爬楼梯

    假设你正在爬楼梯,需要n步你才能到达顶部。但每次你只能爬一步或者两步,你能有多少种不同的方法爬到楼顶部? class Solution { public: /** * @param n: An integer * @return: An integer */ int climbStairs(int
    1500802064   2017-03-06 21:49   0   84
  • 爬楼梯

    public class Solution { /** * @param n: An integer * @return: An integer */ int climbStairs(int n) { if(n==0) { return 1; } int []a=new int[n+1...
    l1500802078   2017-03-06 21:48   0   104