Soyez le premier à donner votre avis sur cette source.
Vue 5 888 fois - Téléchargée 422 fois
Private Sub cmdverif_Click() reu = 0 'variable "réussit" For i = 0 To txtcase.Count - 1 nombre = Val(txtcase.Item(i).Text) If nombre < 1 Or nombre > 25 Then MsgBox "Vous ne devez pas dépasser 25 !" & vbCrLf & "Le Zéro ne compte pas !", , "Nombres" txtcase.Item(i).SelStart = 0 txtcase.Item(i).SelLength = Len(txtcase.Item(i)) txtcase.Item(i).SetFocus Exit Sub End If Next For i = 0 To txtcase.Count - 1 For p = o To txtcase.Count - 1 If i = p Then Exit For Else If txtcase.Item(i) = txtcase.Item(p) Then MsgBox "Vous avez 2 chiffres identiques !" txtcase.Item(i).SelStart = 0 txtcase.Item(i).SelLength = Len(txtcase.Item(i)) txtcase.Item(i).SetFocus Exit Sub End If End If Next p Next i If lbltot.Item(0).Caption = "65" And lbltot.Item(1).Caption = "65" _ And lbltot.Item(2).Caption = "65" And lbltot.Item(3).Caption = "65" _ And lbltot.Item(4).Caption = "65" And lbltot.Item(5).Caption = "65" _ And lbltot.Item(6).Caption = "65" And lbltot.Item(7).Caption = "65" _ And lbltot.Item(8).Caption = "65" And lbltot.Item(9).Caption = "65" _ And lbltot.Item(10).Caption = "65" And lbltot.Item(11).Caption = "65" Then reu = 1 Else reu = 0 End If If reu = 0 Then MsgBox "Na...", , "Manqué !" Else MsgBox "Bravo !!", , "Réussi !" End If End Sub Private Sub cmdreset_Click() For i = 0 To txtcase.Count - 1 txtcase.Item(i).Text = "" txtcase.Item(i).MaxLength = 2 Next For i = 0 To lbltot.Count - 1 lbltot.Item(i).Caption = "0" lbltot.Item(i).FontSize = 10 Next End Sub Private Sub Form_Load() For i = 0 To txtcase.Count - 1 txtcase.Item(i).Text = "" txtcase.Item(i).MaxLength = 2 Next For i = 0 To lbltot.Count - 1 lbltot.Item(i).Caption = "0" lbltot.Item(i).FontSize = 10 Next End Sub Private Sub Form_Unload(Cancel As Integer) End End Sub Private Sub txtcase_Change(Index As Integer) For i = 0 To 4 tot1 = tot1 + Val(txtcase.Item(i).Text) Next lbltot.Item(0).Caption = tot1 '///////////////////////////////////////// For i = 5 To 9 tot2 = tot2 + Val(txtcase.Item(i).Text) Next lbltot.Item(1).Caption = tot2 '///////////////////////////////////////// For i = 10 To 14 tot3 = tot3 + Val(txtcase.Item(i).Text) Next lbltot.Item(2).Caption = tot3 '///////////////////////////////////////// For i = 15 To 19 tot4 = tot4 + Val(txtcase.Item(i).Text) Next lbltot.Item(3).Caption = tot4 '///////////////////////////////////////// For i = 20 To 24 tot5 = tot5 + Val(txtcase.Item(i).Text) Next lbltot.Item(4).Caption = tot5 '///////////////////////////////////////// For i = 0 To 20 Step 5 tot6 = tot6 + Val(txtcase.Item(i).Text) Next lbltot.Item(10).Caption = tot6 '///////////////////////////////////////// For i = 1 To 21 Step 5 tot7 = tot7 + Val(txtcase.Item(i).Text) Next lbltot.Item(9).Caption = tot7 '///////////////////////////////////////// For i = 2 To 22 Step 5 tot8 = tot8 + Val(txtcase.Item(i).Text) Next lbltot.Item(8).Caption = tot8 '///////////////////////////////////////// For i = 3 To 23 Step 5 tot9 = tot9 + Val(txtcase.Item(i).Text) Next lbltot.Item(7).Caption = tot9 '///////////////////////////////////////// For i = 4 To 24 Step 5 tot10 = tot10 + Val(txtcase.Item(i).Text) Next lbltot.Item(6).Caption = tot10 '///////////////////////////////////////// For i = 0 To 24 Step 6 tot11 = tot11 + Val(txtcase.Item(i).Text) Next lbltot.Item(5).Caption = tot11 '///////////////////////////////////////// For i = 4 To 20 Step 4 tot12 = tot12 + Val(txtcase.Item(i).Text) Next lbltot.Item(11).Caption = tot12 End Sub
21 mai 2003 à 21:27
C'est un site de maths amusante, pas scolaire ;)
21 mai 2003 à 21:26
Pour trouver la case centrale,
C=nombre de cases sur 1 côté
Case_centrale=(c+1)/2
Quant au resultat :
4!=1*2*3*4 c'est une factorielle
(je ne vous prend pas pour des c* mais il y a des gens de tout age ici ;))
Grâce a celà vous pourrez déduire comment on obtien la somme ;)
Mais je met ça sur le compte de l'inatention ;)
Je vous invite ici :
www.imaxel.no-ip.com/programaths
(c'est du même genre)
28 déc. 2002 à 02:35
Ce qui est bien c'est qu'on pourrais ajouter autant de cases qu'on veut sans meme toucher au code d'initialisation.
28 déc. 2002 à 00:22
http://rascol.free.fr/4t1/carre/
27 déc. 2002 à 22:45
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.