Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Problema 4 (aproape completa)
- // { , } < >
- #include <iostream>
- #include <fstream>
- using namespace std;
- unsigned int V[10],n;
- int main()
- void interschimbare(unsigned int V[10],unsigned int n)
- {
- unsigned int min,max,aux,i,p,q:
- min=V[1];
- max=V[1];
- for(i=1;i<=1;i++){
- if(V[1]<min){min=V[i];
- p=i;
- }
- if(V[i]>max){max=V[i];
- q=i;
- }
- }
- aux=V[p];V[p]=V[q];V[q]=aux;
- for(i=1;i<=1;i++)cout<<V[i]<<" ";
- }
- unsigned int cifra_control(int n)
- {
- unsigned int S=0;
- while(n!=0){
- S=S+n%10;
- n=n/10;
- }
- while(S>=10){n=S;S=0;
- while (n!=0) {S=S+n%10;
- n=n/10;
- return S;}
- }
- }
- int main ()
- {
- ifstream f(atestat.in);
- ofstream g(atestat.out);
- for(i=1;i =n;i++)f>>V
- Problema 5 (aproape completa)
- #include <iostream>
- #include <fstream>
- using namespace std;
- unsigned int n;
- void suma_cif(int n,int V[10])
- {
- int i, S=0, max;
- x=V[1];
- for(i=1;i<=n;i++)if(V[i]>max)max=V[i];
- while(S!=0){S=S+max%10;
- max=max/10;
- }
- cout<<S;
- }
- int ordine(int n)
- {
- int a=0;
- while ((n!=0)&&(a==0))if(n%10<n/10%10){a=1;n=n/10;}
- if(a==0)return 1;
- else return 0
- }
- int main()
- {
- int i;
- ifstream f(})
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement