Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int nrGr=0;
- int nr,n,m,a[30000][30000];
- int sub1_1()
- {
- int a,b,l,p;
- cin>>a>>b;
- l=a;
- p=0;
- while(a%b!=0)
- {
- p+=a/b+2;
- a=l-(b-(a%b));
- }
- p+=a/b-1;
- return p;
- }
- void sub1_2()
- {int n;cin>>n;
- int v[n][n];
- vector <int> w[9];
- for(int i=0;i<=9;i++)
- {
- w[i]=0;
- }
- for(int i=1;i<=n;i++)
- {
- int x;
- cin>>x;
- int c1=0;
- int y=x;
- while(x)
- {
- if(23%2==1)
- {
- c1++;
- }
- x/=2;
- }
- w[c1]++;
- v[c1][w[c1]]=y;
- }
- for(int i=1;i<=9;i++)
- {
- if(w[i])
- {
- nrGr++;cout<<"(";
- for(int j=1;j<w[i];j++)
- {
- cout<<a[i][j]<<",";
- }
- cout<<a[i][w[i]]<<") ";
- }
- }
- }
- void citire_sub3()
- {
- cin>>nr>>m>>n;
- for(int i=1;i<=n;i++)
- {
- for(int j=1;j<=m;j++)
- {
- cin>>a[i][j];
- }
- }
- }
- int cifra_control_sub3(int n)
- {
- int s=0;
- while(n)
- {
- s+=n%10;
- n/=10;
- }
- if(s>10)
- {
- cifra_control_sub3(s);
- }
- else
- {
- return s;
- }
- }
- void det_prefix_max_sub3()
- {int v[9](0);
- for(int i=1;i<=n;i++)
- {
- for(int j=1;j<=m;j++)
- {
- int x=cifra_control_sub3(a[i][j]);
- v[x]++;
- }
- }
- while(nr)
- {
- t=t*10+nr%10;
- nr/=10;
- }
- int c=t%10;
- int pr=0;
- while(c)
- {
- v[c]--;
- pr=pr*10+c;
- t/=10;
- c=t;
- }
- if(!pr)
- {
- cout<<"nu exista";
- }
- else
- {
- cout<<pr;
- }
- }
- int main()
- {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement