lsy263 @ 2019-10-19 22:48:08
rt
#include<iostream>
using namespace std;
int a,b;
int main(){
cin >> a >> b;
auto Add=[](int a,int b){return a+b;};
cout<<Add(a,b);
return 0;
}
好康不
请自行百度lambda表达式
by t162 @ 2019-10-19 22:48:39
致远星
by tiger0133 @ 2019-10-19 22:48:51
zyx
by Boeing737_MAX_8 @ 2019-10-19 22:49:47
你看看这个吧
by Y_用户 @ 2019-10-19 22:49:57
前排
by Boeing737_MAX_8 @ 2019-10-19 22:53:44
c++17新特性,上头那个只有11、14
by Vocalise @ 2019-10-19 22:53:48
这不是基础知识吗,再说C++11不是不能进考场吗
by lsy263 @ 2019-10-19 23:22:54
好,您nb,我分享一下怎么个个都好像很强一样,呵
by ud2_ @ 2019-10-23 15:25:33
rt
#include <functional>
#include <iostream>
int main() {
int a;
int b;
std::cin >> a >> b;
std::cout << std::plus<int>()(a, b) << std::endl;
return 0;
}
好康不
请自行百度函数对象
(
by fz20181223 @ 2019-11-07 16:07:16
全是大佬
by 李禹墨 @ 2019-11-14 19:59:08
using namespace std; const int a=2000; int b,c,y,z,i; int d[a],e[a],f[a]; char g[a],h[a]; void convent(char g[],int d[]) { b=strlen(g); for(c=1;c<=b;c++) { d[c]=g[b-c]-'0'; } d[0]=b; } void add(int a[],int b[],int c[]) { if (a[0]>b[0]) { y=a[0]; } else { y=b[0]; } for(int x=1;x<=y;x++) { c[x]=a[x]+b[x]+z; z=c[x]/10; c[x]%=10; } c[0]=y; if(z>0) { c[0]++; c[c[0]]=z; } } void print(int c[]) { for(i=c[0];i>=1;i--) { printf("%d",c[i]); } } int main() { scanf("%s %s",g,h); convent(g,d); convent(h,e); add(d,e,f); print(f); return 0; }```cpp