// First program example#import int main (int argc, const char * argv[]) { @autoreleasepool { NSLog (@"Programming is fun!"); } return...
分类:
其他好文 时间:
2014-07-06 13:03:34
阅读次数:
177
最长单调递增子序列问题
题目:设计一个 O( n ^ 2 )复杂度的算法,找出由 n 个数组成的序列的最长单调递增子序列。
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.i...
分类:
其他好文 时间:
2014-07-06 11:30:45
阅读次数:
176
把基本知识过了一遍,发现了几个自己容易 出错的小程序,记录下来。。。。
1,关于try-catch异常
1,关于try-catch异常
package chapter5;
public class p101 {
public static void main(String args[])
{
int a[]=new int[3];
try{...
分类:
编程语言 时间:
2014-07-06 11:11:59
阅读次数:
175
问题:
scanf("%s", a);
运行输入hello world
回车
则输入到a的只是空格之前的部分,怎样把空格之后的部分也输出?
1. scanf( "%[^\n]", str );
#include
int main(){
char str[50];
scanf( "%[^\n]", str );
printf( "%s\...
分类:
编程语言 时间:
2014-07-06 11:05:52
阅读次数:
211
今天来按照apidemos提供的方法来实现slow loading的效果.
Main.java
import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view...
合并输入的两个整形数组并去掉重复的数字按升序输出;
案例输入:3
1 2 5
4
-1 0 3 2
案例输出:-101#include
#include
using namespace std;
void maopao(vector&arry);
int main(...
分类:
其他好文 时间:
2014-07-06 10:17:14
阅读次数:
222
又出错了。。
main.obj:-1: error: LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall MyView::metaObject(void)const " (?metaObject@MyView@@UBEPBUQMetaObject@@XZ)
main.obj:-1: error: L...
分类:
其他好文 时间:
2014-07-06 09:07:57
阅读次数:
300
两个奇葩的C语言程序
#include
#include
void main(int i) {
printf("%d\n", i);
(&main + (&exit - &main)*(i/1000))(i+1);
}...
分类:
编程语言 时间:
2014-07-06 08:49:11
阅读次数:
359
一、最基本的用法cin>>
接收一个数字、字符、字符串,遇“空格”、“TAB”、“回车”都结束
例如: #include
using namespace std;
main ()
{
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
}输入:5[回车]6[回车]
输出:11
(其中回车可替换成空格或者TA...
分类:
编程语言 时间:
2014-07-06 00:16:27
阅读次数:
270
题意:求/直线的对称矩阵最大多大
思路:DP 每个点就是了
#include
#include
#include
#include
using namespace std;
const int MAXN = 1200;
int dp[MAXN][MAXN];
char str[MAXN][MAXN];
int n;
int main() {
while (scanf("%d", ...
分类:
其他好文 时间:
2014-07-06 00:10:36
阅读次数:
291