0 like 0 dislike
請撰寫一個程式,其程式讓使用者設定密碼,密碼需有英文字母及數字且字數在6到10字間,若其中一條件不符合則輸出error,若都符合則輸出finish。

範例輸入1  ffg2573

範例輸出1  finish

範例輸入2  54454589712

範例輸出2 error
[Normal] Coding (C) - asked in 2016-1 程式設計(一)AC
ID: 20997 - Available when: Unlimited - Due to: Unlimited

reshown by | 203 views

3 Answers

0 like 0 dislike
Hidden content!
* ** * *** * * **

*** ** ** * * *

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



int main (void)

{ ** * ** * * ***
*** * * *** ******* * a=0,b,c=0,d=0,k;

*** * ** ** ** * ** * s[99];



* ** * * ** * * * *** * *** ("%s",s);

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

** *** ** *** * *
* * * *** ******* * ** * || a>10)

* * * *** ** ** * *  
* * * *** * ***** (k=0;k<a;k++)

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

** * ** * * * ** * * ** (isalpha(s[k]))

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

* * * *** ** * **** * (isdigit(s[k]))

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

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


* ** ** ** * * *** (d+c!=a)

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

**** * ** * * ***** (d==0||c==0)

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

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

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

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

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



 
* *** ** * * **** ** * * 0;

}
answered by (-122 points)
0 like 0 dislike
Hidden content!
******* ** **

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

* * *** ** * * **

* ** ** ** **



int main (void)

{ ** * * * ***** *
** ** * * ** * * ** a=0,b,c=0,d=0,i,k,j;

* *** ** **** **** * s[99],z[a-1];



** ********* * * * * ("%s",s);

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

* * * * * **** **** ***
* ** **** * * * * * * || a>10)

** ** * * * ** ** * *  
*** *** * * * *** ** ** * * * (i=0;i<a;i++)

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

* * ** * * * * * * * * (isalnum(s[i]))

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

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

* *** ***** * *** * * * * ** * (c!=a)

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

** **** ** * * * * * * ** (k=0;k<a;k++)

** * ** ** *

* * *** * ** *** * * * (isalpha(s[k]))

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

* * * ** ** ***** (isdigit(s[k]))

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

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


*** ** * ** ** * * (d+c!=a)

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

** ***** * * ** (d==0||c==0)

** * * ** *****

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

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

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

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



 
* ** ** ***** * * *** 0;

}
answered by (-102 points)
0 like 0 dislike
Hidden content!
*** **** * ********
** **** **** * * **
* ** **** ********
** * * * * *



int main (void)

{ * ***
* *** * * * * *** * * *** **
* **** * **** * * s[99],z[a-1];


*** * * *** * * * * * * *** * * * * * ***
** * ** * ** ** * * * *
*** *** * * * ***
** * * *** ** ** ****** * *** || a>10)
* ******* *** * ** * * *

** **** ** * * *** *****
* ******* ** * * ** ** ***
***** *** * *** **** ** ** (isalnum(s[i]))
** * * * * ** **** *** * * *
*** **** * ** ** * ** ***
*** **** * *** * * ** (c!=a)
* * * ** * ** ** ** ** **
** * ** * * * * * *** (k=0;k<a;k++)
* * ** *** ** * **** **
* ****** * * *** ** *** ** ** (isalpha(s[k]))
*** ** **** * *** * **
* * ***** * **** (isdigit(s[k]))
* ** *** ** *******
*** * * * ********* * * *  



    if (d+c!=a)

    b=1;

    if (d==0||c==0)

    b=1;
* ***** * * * *** * *
*** * * * * ** ** *** * * * * *****
* * ** *** ** *** **** *** *
* * * ** *** ** ** * * **** * * *





    return 0;

}
answered by (-136 points)
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.70.175.73
©2016-2022

Related questions

0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC by 410425014 (-162 points)
ID: 20514 - Available when: Unlimited - Due to: Unlimited
| 243 views
0 like 0 dislike
23 answers
[Normal] Coding (C) - asked Dec 13, 2016 in 2016-1 程式設計(一)AC by HoMingJui (-126 points)
ID: 19222 - Available when: Unlimited - Due to: Unlimited
| 722 views
2 like 0 dislike
14 answers
[Normal] Coding (C) - asked Dec 21, 2016 in 2016-1 程式設計(一)AC
ID: 19745 - Available when: Unlimited - Due to: Unlimited
| 463 views
0 like 0 dislike
7 answers
[Normal] Coding (C) - asked Jan 5, 2017 in 2016-1 程式設計(一)AC by 林佳慧 (-85 points)
ID: 20976 - Available when: Unlimited - Due to: Unlimited
| 284 views
0 like 0 dislike
31 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC
ID: 20482 - Available when: Unlimited - Due to: Unlimited
| 1k views
13,769 questions
207,306 answers
186,853 comments
5,422 users