Skip to content

Instantly share code, notes, and snippets.

@YaoC
Created January 16, 2017 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YaoC/4c3a5b2deac75203be5e974e665aaa1b to your computer and use it in GitHub Desktop.
Save YaoC/4c3a5b2deac75203be5e974e665aaa1b to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
cout<<"你输入了"<<argc-1<<"个参数"<<endl;
if(argc==1)
return 0;
if(argc==2)
cout << "读入图片" << argv[1] << endl;
if(argc==3) {
cout << "指定尺寸错误!\n";
return 0;
}
if(argc==4){
cout << "读入图片的大小为" << argv[2] << "*" << argv[3] << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment