您正在查看 "c/c++" 分类下的文章
2009-11-04 17:12
2009-10-30 14:28
#include <iostream>
#include <algorithm>
#include <vector>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> cpl;
int main(){
cpl c1(1,2);
cpl c2(3,4);
cout<<c1<<endl; //(1,2)
cout<<c2<<endl; //(3,4)
cpl c3 = c1*c2; //-5 + 10 i
cout<<c3<<endl;
cpl c4 = c1+c2;
cout<<c4<<endl; //(4,6)
cpl c5 = c1/c2;
|
2009-10-28 01:05
#include <sstream>
stringstream mysin;
getline(cin,buff);
cout<<buff<<endl;
mysin.str(buff);
mysin>>cas; |
2009-10-04 15:37
逐个字符输出

//start
// exp05.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "exp05.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTA |
2009-09-19 22:40
//start lex
%{
#include <stdlib.h>
int yyerror(char *);
#include "tmpyacc.h"
%}
%%
[a-z] {
yylval = *yytext -'a';
return VARIABLE;
}
[0-9]+ {
yylval = atoi(yytext);
return INTEGER;
}
[-+()=/*\n] {
yylval = *yytext;
return *yytext;
}
%%
int yywrap(void){
return 1;
}
//end
//start
%token INTEGER VARIABLE
%left '+' '-'
%left '*' '/'
//放置上下的顺序和优先 |
2009-09-19 22:04
2009-09-19 21:36
2009-09-18 10:00
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
#include <ctype.h>
#include <algorithm>
using namespace std;
/*
tyName:
Reserved , Operator, Identifier ,Constant,Delimiter
*/
class Token{
private:
string tyName; // name of type
string org; //orgine of Token
int val; // value of Token
string getType(string);
int ge |
2009-09-08 09:14
// yjyrun.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <windows.h>
int main(int argc , char * argv[])
{
STARTUPINFO si={sizeof(si)};
PROCESS_INFORMATION pi;
char * file = argv[1];
if (CreateProcess(NULL,file,NULL,NULL,false,0,NULL,NULL,&si,&pi)){
printf("ok!\n");
}else{
printf("Sorry!\n");
}
return 0;
|
2009-07-23 22:05

//start
/** Example 005 User Interface
This tutorial shows how to use the built in User Interface of
the Irrlicht Engine. It will give a brief overview and show
how to create and use windows, buttons, scroll bars, static
texts, and list boxes.
As always, we include the header files, and use the |
2009-07-23 21:11

//start
// irrfirst.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
|
2009-07-22 12:02

//start
// irrfirst.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using na |
2009-07-15 11:50

//start
// irrfirst.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using na |
2009-07-14 11:08
最近有个项目 , 要用到 , 感觉很好用 。

环境很好配 ,
//start
// irrfirst.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
using nam |
2009-07-01 15:26
//start
#include <opencv/cv.h>
#include <opencv/highgui.h>
#include <stdlib.h>
#include <stdio.h>
int main( int argc, char** argv ){
IplImage * src = cvLoadImage(argv[1]);
CvSize sz;
double scale = 0.25;
sz.width = src->width*scale;
sz.height = src->height*scale;
IplImage * dest = cvCreateImage(sz, |
|
|