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

範例輸入1  ffg2573

範例輸出1  finish

範例輸入2  54454589712

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

reshown by | 83 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)
Get it on Google Play Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.63.93
©2016-2021

Related questions

0 like 0 dislike
3 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC by 410425014 (-162 points)
Available when: Unlimited - Due to: Unlimited
| 97 views
0 like 0 dislike
23 answers
[Normal] Coding (C) - asked Dec 13, 2016 in 2016-1 程式設計(一)AC by HoMingJui (-126 points)
Available when: Unlimited - Due to: Unlimited
| 250 views
2 like 0 dislike
14 answers
[Normal] Coding (C) - asked Dec 21, 2016 in 2016-1 程式設計(一)AC
Available when: Unlimited - Due to: Unlimited
| 182 views
0 like 0 dislike
7 answers
[Normal] Coding (C) - asked Jan 5, 2017 in 2016-1 程式設計(一)AC by 林佳慧 (-85 points)
Available when: Unlimited - Due to: Unlimited
| 102 views
0 like 0 dislike
31 answers
[Normal] Coding (C) - asked Jan 3, 2017 in 2016-1 程式設計(一)AC
Available when: Unlimited - Due to: Unlimited
| 318 views
11,163 questions
132,617 answers
129,948 comments
3,823 users