Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- const int MAX = 100 ;
- int i, chan,le;
- long long x;
- void NhapMang(long long a[], int n){
- for(i = 0;i < n; ++i){
- scanf("\n%lld", &a[i]);
- }
- }
- void XuatMang(long long a[], int n){
- for(i = 0;i < n; ++i){
- chan = 0;
- le = 0;
- while (a[i]>0){
- x = a[i] % 10;
- a[i] = a[i] / 10;
- if (a[i]%2==0){
- chan++;
- } else {
- le ++;
- }
- }
- printf("%d %d \n", le ,chan);
- }
- }
- int main()
- {
- long long arr[MAX];
- int n;
- do{
- scanf("%d", &n);
- if(n <= 0 || n > MAX){
- return 0;
- }
- }while(n <= 0 || n > MAX);
- NhapMang(arr, n);
- XuatMang(arr, n);
- return 0;
- }
Add Comment
Please, Sign In to add comment