GoConqr has a new look! Let us know what you think.

Mind map

Rezolvari

Deleted user User has deleted their subject information English

Map content

Rezolvari

  1. Exemplu În urma apelului FRadical(15000, x, y), se obține x = 50, y = 6. #include <iostream> #include <cmath> using namespace std; void FRadical(long n,long &x,long &y) { int ind=0; for(y=1;y<=n && ind==0;y++) { if(n%y==0) { x=sqrt(n/y); if(x*x==n/y) ind=1; } } y--; } int main() { long n; cin>>n; long x,y; FRadical(n,x,y); cout<<x<<' '<<y; return 0; }

  2. 2. #include <iostream> using namespace std; void sum_cif(long n,int &s) { if(n>=10) { sum_cif(n/10,s); s=s+n%10; } else s=n; } int main() { long n; int s; cin>>n; sum_cif(n,s); cout<<s; return 0; }

  3. 3. Dacă n are valoarea 85412, după apelul dublare1(n), n va fi 885412. #include <iostream> using namespace std; void dublare1(long &n) { long p=1; while(n/p>9) { p=p*10; } n=(n/p)*p*10+n; } int main() { long n; cin>>n; dublare1(n); cout<<n; return 0; }

  4. 4. Dacă n = 1372, după apelul funcției perm, valoarea lui n va fi 3721. #include <iostream> void perm(long &n) { long p=1; while(n/p>9) { p=p*10; } n=n%p*10+n/p; } using namespace std; int main() { long n; cin>>n; perm(n); cout<<n; return 0; }

Information

Description
User has deleted their subject information Mind Map on Rezolvari, created by Deleted user on 08/05/2020.
Created by
Deleted user · May 2020
Updated
May 8, 2020
Views
12
History
  • Created by AIDA-MARIA TURBUREANU · May 8, 2020
  • Copied by AIDA-MARIA TURBUREANU · May 8, 2020
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?