foo.cpp:1:1: error: 'include' does not name a type
include<iostream>
^
foo.cpp:9:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main()
^
foo.cpp: In function 'int main()':
foo.cpp:11:1: error: 'cin' was not declared in this scope
cin>>n>>m; for (int i=1;i<=n;i++) cin>>a[i]; for (int i=1;i<=m;i++) next_permutation(a+1,a+n+1); for (int i=1;i<=n;i++) cout<<a[i]<<' '; }
^
foo.cpp:11:95: error: 'next_permutation' was not declared in this scope
cin>>n>>m; for (int i=1;i<=n;i++) cin>>a[i]; for (int i=1;i<=m;i++) next_permutation(a+1,a+n+1); for (int i=1;i<=n;i++) cout<<a[i]<<' '; }
^
foo.cpp:11:121: error: 'cout' was not declared in this scope
cin>>n>>m; for (int i=1;i<=n;i++) cin>>a[i]; for (int i=1;i<=m;i++) next_permutation(a+1,a+n+1); for (int i=1;i<=n;i++) cout<<a[i]<<' '; }
^