3 喜歡 0 不喜歡
8.8k 瀏覽

若一個正整數的奇數位數字和與偶數位數字和兩者差的絕對值是11的倍數,則這個正整數就是11的倍數,否則就不是11的倍數。

請寫一個程式來判斷輸入的數是不是十一的倍數。

 

輸入說明:

會輸入一個正整數N,N不會超過1000位。

 

輸出說明:

如果輸入的數字是11的倍數就在螢幕上輸出YES,否則就輸出NO。

 

輸入範例:
 

11111111111111111111111111111111111111111111111111



 

輸出範例:

 

YES
[考試] 最新提問 分類:2017-1 程式設計(一)AD | 用戶: (30k 分)
ID: 38939 - 從幾時開始: 2017-12-23 09:00 - 到幾時結束: 2017-12-23 12:10
| 8.8k 瀏覽

16 個回答

0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

int main()
{
* ** *** ** * arr[1000];
   int even=0,odd=0,i,n,sum;
* ** *** * *** * ** * ***** * * **
* ***** ** * ** * * * * *
*** * * * ** * ** * ** * * *
***** * *** * * **** ** ** *** *
   {
* ******* ** *** * * ******* *** * *
*** * ** ******* ** * **** * * * ******** ***** * * **** **** ****
* *** * * ***** *********** * * *
** ** * * ** **** ** * **** ** ** * ** * ** ****** ****** ** ***
   }
**** ** ****** * ** ***
* * * ** * ** ** *** * *
** * ** * * ** * *** ** * * ** * *** **
* ** * * * * * * * *
**** ** ** * ** ** * ****

* * * * * ** * 0;
}
最新回答 用戶: (164 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Correct output
Case 5: Correct output
Case 6: Correct output
Case 7: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
int main()
{
* * ** *** * **** ***** ch[1000]={0};
* ** * * *** ** * b,even, odd;
* ** ** * ***** * * * * * * *** *** ** **
* * * * ** * *** * ** * *
* *** * * *** *** (b=0;b!='\0';b++)
   {
** ** ** * * *** * ** * *** ** *** * **
** ** ** * * * ** *** * *
* ** * * ** * *** ** ** ** * * **** * ** ***** * * * *****
* ** ** * * ** ** * **** *** ** *
* * *** ****** * * * ** *** * *** * ** ** ** * * *
* ** ** *** ** * ** * * ** * ** *** * * ** *
*** * * * ** * ** * **** * * **** **** ****** ** * * * * ** ** * *
* *** * *** * * * * **** * ** * * **** * *** * *** * **

   }
** * * * *** *** ** ** **
*** * ** ****** *
*** * ** * *** * ** ** * * * * * ** **
   }
* * * *** * ***
   {
**** * *** * ** ***** *** * * **
   }
*** *** *** * * ****** 0;

}
最新回答 用戶: (162 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>

int main(void){
* * * **** * * arr[1000];
   int even=0,odd=0,i,n,sum;
* * * * ** ***** * ** ** *
* * *** ** * * * * ** **
* * ** * ** * ** **** *** * * ** *
* * ** * * *** * ** ** ** * **
*** * ********* * ****** * * ** * **
* * ** * **** * *** ** * ** * ** * ** * ** *** * * **** * *** **
*** ****** *** ** **** ** * *
* *** * * * * * * * * * * *** ****** * **** ** **
   }
* *** * * **** *** *
* * * * *** *** ** *
** * * ** * ****** * * ** * * ** *
* ***** * * * ** * * ** **
*** *** * *** * * * ** * *** *
  
** * * *** * *** ****** 0;
}
最新回答 用戶: (131 分)
修改於 用戶:
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
prog.c: In function 'main':
prog.c:20:4: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
    system("pause")
    ^~~~~~
prog.c:21:4: error: expected ';' before 'return'
    return 0;
    ^~~~~~
0 0
prog.c: In function 'main':
prog.c:20:4: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
    system("pause");
    ^~~~~~
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Correct output
Case 5: Correct output
Case 6: Correct output
Case 7: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
int main()
{
    int n;
    int a[1000];
    scanf("%d",&a[n]);
    if(a[n]%11==0)
    {
* * **** ** * ** ** **** ****** *** ** * ** ** ** **** ** *** * *** * *** *** ** *** ****** ** * *** * ** * ***** *
*** * *** * * * * ** * *** *** *** * ** ** ** ** * ** * * * * ******** ** **** * * * *****
* *** * ** * * * * **** ** *** *** * *** * * * * ** *** ** *** ** ** * **** *** ** ** **** ***
* **** * * * * *** ******** **** * * ** * * ** *** ***** ** *** **** ** * ** * * * *** ** ** *** * ** * * ***** *
**** *** ** ** ** ** * * ** * ** *** ** * * * * **** **** * ** * *** * * * * * ** ****** * ** * ** * *** * * *** *****
** ** ** *** * ** ** **** * ** * ** ** ** ** *** * ** * * * * *** **** *** **** ** * * * ***** * * * * ******* ** *
** * * ** * * * * *** ** *** *** * ** ******* * **** * ** * * * ** * * * **** * * *** * **** * * ** * * ***** * 0;
***** * * *** * * * ** * *** ** ****** * *** * * * ** * ** * *** **** ** * * * ** * * * ** *** ** * *** ** ** ** *
最新回答 用戶: (190 分)
修改於 用戶:
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
prog.c: In function 'main':
prog.c:6:17: error: 'a' undeclared (first use in this function)
     scanf("%d",&a[n]);
                 ^
prog.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
** ** * * * * * * * i,j,odd=0,even=0;
** ** ** * * ***** ** * * str[1000];
* * *** ** * * * * ** ** * *** * * * **
*** **** * ***** ***** * ** ** * *
* * ** ** ** *** **** * * ** * ** ******* * * **** 0;
** ** *** * ** ** * * * **** * *
* * ** **** * * **
**** * * ** ** * * * * * * * * * ** * * ** ***** ***
* *** * * * ** **
* **** ** * * * ** * * * * ** **
    {
** * * ***** ** * ** ** ** **** * * ***** * * ***** ** * *
    }
**** * ****** ** ** *** *** * * * *** **** * *
*** * * ***** **** ***** * *** * ** * ********* ****
* ** * ** * **** * * *
**** ** ** ** * * ** * *** * * ************ ** ** ******
** * *** ** ** * *** * **** *** ******* ** *
* ** **** * * * * ** * * 0;
}
最新回答 用戶: (114 分)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Correct output
Case 5: Correct output
Case 6: Correct output
Case 7: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
int main()
{
* ** * * * * * ** * * n,k,a=0,b=0;
* * *** **** * **** ** ** num[10000];
**** ** ** * * * * ** ***
** * * ****** ** ** * **
    {

* * * * * * ** ** ** ** *** * ** ** ***
* * * * * ** * ** * * *** ** * ** ** * ****** ** * *** *
* *** * *** ** ** * * * * **** *** * ****
* ***** * * * * * * * ** * ****** ** * ***** ** * * * * * * * * ***

    }

** * * * * * *** ** * * *
*** * ** ** ** *** **** *** ** * ** * ** * *** ** * *** * * * * * * ***
* ** * ** ** *** * *** * **
**** * * * * ** * * * ** ** ** * * ***** * * * **** *
 return 0;
}
最新回答 用戶: (236 分)
0 0
prog.c: In function 'main':
prog.c:6:5: warning: 'gets' is deprecated [-Wdeprecated-declarations]
     gets(num);
     ^~~~
In file included from prog.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/tmp/ccgmKRMg.o: In function `main':
prog.c:(.text+0x39): warning: the `gets' function is dangerous and should not be used.
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
int main()
{
    int k,a,b;
* * **** * * * * **** arr[1000]={0};
** * * * * * ** *** n,j;
* * * * *** * * * **** *** ** * ***
    
** ** * * * * * * * *** **
* ** * * ***** * *** * ***
* * * * * *** * * * * **** * *** * arr[k];
** ** **** * * ** ** * * ** **
* ** *** * * *** *
** * ** ** * * * *** * *** *** * ;
* **** * ** *** ** * ***** * *** ** * *** * *** * * ** * * * **** * *** * ** *
    }
    
* ** * * ** ** *******
**** *** * ** **** * ** ** * * * **** * * ** * *
* * * * * *** * ** ** * ****
** **** * ** ** * * * * *
*** * * ** * *** * * * * ** ** * ** * * *********
* * * * **** *** **** * *
* * ** * * ** **** ** **** *** * * 0 ;

}
最新回答 用戶: (194 分)
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
int main ()
{
   
    int n;
    int a[1000];
    scanf("%d",&a[n]);

* *** * * * ***** ***** ** *** * * * *** ***** * ** ******
****** * ***** *** * *** * * *** **** ** ** ** ** * * *** ** * ** * * * *
*** * **** * * ** **** * *** * ****** * ** **** * ** ** *** *** **
* * * *** ** ** * ****** *** *** * ** *** ** ** * * ** * * * * *** ** **** * * **
* *** * ** * *** **** * ** * * * ** * * ** **** * * ** * ** ** *** ** **
* *** * ** ** * * * ** * * *** * * ** * * * * ** ***** * *** *
*** **** ** ****** **** ** * * * ** * * *** *** * * ** * ** ** ** **
** * ** ***** * ** ** ** * * * * * * * ** * * ** **** ** * ****** * * * ** **** *******
* *** * * ** ** * * ** ****** * * **** * * ** ** ** * * ** * * ** *
* ** ****** * * * * *** ** ****** * ***** ***** ** ** ** ** *** 0;
* * ***** * * * * **** ** ** *** *** **** * * * ** * ** *
    
* ** *** * ******* * ** ****** ** * ***** * * *** * ** ** ** * * ** ** *
}
最新回答 用戶: (196 分)
0 0
prog.c: In function 'main':
prog.c:19:14: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
              system("pause");
              ^~~~~~
0 0
Case 0: Wrong output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Wrong output
Case 5: Correct output
Case 6: Wrong output
Case 7: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
int main()
{
** * * * * ** *** * * n;
   
* ***** * ** * * ** * ** *** * *** &n);
* * * ** * * * **
* ** * * * * ** * * * *
* ** * *** **** ****** ** ** * ** *****
* ** * * ** * * ****
* *** ** ***** ** * ** ***** **
* * ** * * * * ***** *
    
* * * *** * * * * * * * 0;
}
*** *** * **** ** * ** *** * ** *** * * ** * * * * * * * * *** **** * * ******* * * * ** *** ** *
最新回答 用戶: (160 分)
修改於 用戶:
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
Case 0: Wrong output
Case 1: Correct output
Case 2: Correct output
Case 3: Correct output
Case 4: Wrong output
Case 5: Correct output
Case 6: Wrong output
Case 7: Correct output
0 喜歡 0 不喜歡
內容已隱藏
#include<stdio.h>
int main()
{
    int i,a=0,b=0;
* ** *** * ** * * * arr[1000];
* ** ** ** * * ** ******
** * **** * ** i=0;arr[i]!='\0';i++)
    {
** * * * * **** * * * ** * ** * ****** ** *
* * * ** * *** * * * * * ****** * * ** **** *** * ** * *
* * * * **** * *** * ** ** **** * *** ** * * * *** if(i%2!=0)
*** * **** * ** ** ****** *** * * *** * * **** * * * ** * *** * ****** ****
    }
*** * * * ** * * **** * * * * ***** *
** * * **** * ** ** * * ** * * * * *
* * * ** ** ** * **** ** * if (i%2!=0)
* * **** * ** ** * ****** * *** * * ** ** * * **
* * * * *** ** *** * ***
* *** ** * *** * ** * ** *** * * *** * *** * * *** ** *
* ****** *** * * * *** ** *
** ** * * * ***** ** * ******* * *** ** ** ** ****
** * * * *** * * * ** * ** *** * *
    
}
最新回答 用戶: (172 分)
修改於 用戶:
0 0
prog.c: In function 'main':
prog.c:6:5: warning: 'gets' is deprecated [-Wdeprecated-declarations]
     gets(arr);
     ^~~~
In file included from prog.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/tmp/cckn201s.o: In function `main':
prog.c:(.text+0x39): warning: the `gets' function is dangerous and should not be used.
0 0
Case 0: Wrong output
Case 1: Wrong output
Case 2: Wrong output
Case 3: Wrong output
Case 4: Wrong output
Case 5: Wrong output
Case 6: Wrong output
Case 7: Wrong output
0 0
prog.c: In function 'main':
prog.c:23:5: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
     system("pause")
     ^~~~~~
prog.c:24:1: error: expected ';' before '}' token
 }
 ^
0 0
prog.c: In function 'main':
prog.c:23:5: warning: implicit declaration of function 'system' [-Wimplicit-function-declaration]
     system("pause");
     ^~~~~~
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Case 3: Wrong output
Case 4: Correct output
Case 5: Correct output
Case 6: Wrong output
Case 7: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:104.23.197.95
©2016-2026

相關問題

2 喜歡 0 不喜歡
5 回答
[考試] 最新提問 12月 23, 2017 分類:2017-1 程式設計(一)AD | 用戶: 楊修俊 (30k 分)
ID: 38942 - 從幾時開始: 2017-12-23 09:00 - 到幾時結束: 2017-12-23 12:10
| 3k 瀏覽
2 喜歡 0 不喜歡
18 回答
[考試] 最新提問 12月 23, 2017 分類:2017-1 程式設計(一)AD | 用戶: 楊修俊 (30k 分)
ID: 38941 - 從幾時開始: 2017-12-23 09:00 - 到幾時結束: 2017-12-23 12:10
| 7.7k 瀏覽
4 喜歡 0 不喜歡
16 回答
[考試] 最新提問 12月 23, 2017 分類:2017-1 程式設計(一)AD | 用戶: 楊修俊 (30k 分)
ID: 38940 - 從幾時開始: 2017-12-23 09:00 - 到幾時結束: 2017-12-23 12:10
| 12k 瀏覽
3 喜歡 0 不喜歡
12 回答
[考試] 最新提問 12月 23, 2017 分類:2017-1 程式設計(一)AD | 用戶: 楊修俊 (30k 分)
ID: 38938 - 從幾時開始: 2017-12-23 09:00 - 到幾時結束: 2017-12-23 12:10
| 6.2k 瀏覽
2 喜歡 0 不喜歡
3 回答
[正常] Coding (C) - 最新提問 12月 20, 2017 分類:2017-1 程式設計(一)AD | 用戶: 楊修俊 (30k 分)
ID: 38168 - 從幾時開始: 無限制 - 到幾時結束: 無限制
| 1.9k 瀏覽
12,783 問題
183,442 回答
172,219 留言
4,824 用戶