You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include<stdio.h>
int soChuSo(int n){
if(n==0)
return 0;
return 1+soChuSo(n/10);
}
int tongChuSo(int n){
if(n>0)
return n%10+tongChuSo(n/10);
return 0;
}
int main(){
int n;
printf("Nhap so nguyen n: ");
scanf("%d",&n);
printf("So n co %d chu so\n",soChuSo(n));
printf("Tong cac chu so cua n la: %d\n",tongChuSo(n));
return 0;
}
i have a some problems
anyones help mee :(((
#include<stdio.h>
int soChuSo(int n){
if(n==0)
return 0;
return 1+soChuSo(n/10);
}
int tongChuSo(int n){
if(n>0)
return n%10+tongChuSo(n/10);
return 0;
}
int main(){
int n;
printf("Nhap so nguyen n: ");
scanf("%d",&n);
printf("So n co %d chu so\n",soChuSo(n));
printf("Tong cac chu so cua n la: %d\n",tongChuSo(n));
return 0;
}
Originally posted by @hoang1904 in #243 (comment)
The text was updated successfully, but these errors were encountered: