File:Felices.jpg
![File:Felices.jpg](https://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/Felices.jpg/192px-Felices.jpg?20100206205407)
Original file (257 × 803 pixels, file size: 28 KB, MIME type: image/jpeg)
Captions
Captions
Summary[edit]
DescriptionFelices.jpg |
English: the source code of the happy numbers algorithm
Español: es el codigo fuente del algoritmo numeros felices
Esperanto: la fontkodo de la algoritmo de feliĉaj nombroj
Polski: kod źródłowy algorytmu rozpoznawania liczb szczęśliwych
#include<conio.h>
#include<iostream.h>
void imprimir(){
cout<<"si es feliz";
}
void resolver(int b,int z){
if(z==100){
cout<<"infeliz";
}
else{
if( (b>0)&&(b<10) ){
b=b*b;
}
else if ((b>9)&&(b<100)){
int c=0,d=0;
d=b%10;
c=b/10;
b=(c*c)+(d*d);
}
else if ((b>99)&&(b<1000)){
int e=0,f=0,g=0;
e=b/100;
f=(b%100)/10;
g=(b%100)%10;
b=(e*e)+(f*f)+(g*g);
}
if(b==1){
imprimir();
}
else{
resolver(b, z+1) ;
}
}
}
void main (){
int a,z=0;
cout<<"escriba un numero";
cin>>a;
resolver(a,z);
}
#include<iostream>
using namespace std;
void imprimir(){
cout<<"si es feliz"<<endl;
}
void resolver(int b, int z){
if(z==100){
cout<<"infeliz"<<endl;
}
else{
if((b>0)&&(b<10)){
b=b*b;
}
else if((b>9)&&(b<100)){
int c=0,d=0;
d=b%10;
c=b/10;
b=(c*c)+(d*d);
}
else if((b>99)&&(b<1000)){
int e=0, f=0, g=0;
e=b/100;
f=(b%100)/10;
g=(b%100)%10;
b=(e*e)+(f*f)+(g*g);
}
if(b==1){
imprimir();
}
else{
resolver(b, z+1) ;
}
}
}
int main (){
int a, z=0;
cout<<"escriba un numero: ";
cin>>a;
resolver(a, z);
}
|
|||
Date | ||||
Source |
English: work in class
Español: trabajo en clase
Esperanto: laboro en klaso
Polski: praca w klasie |
|||
Author | Christhiangordillo | |||
Other versions |
|
Licensing[edit]
![]() |
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.http://www.gnu.org/copyleft/fdl.htmlGFDLGNU Free Documentation Licensetruetrue |
![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 20:54, 6 February 2010 | ![]() | 257 × 803 (28 KB) | Christhiangordillo (talk | contribs) | {{Information |Description={{es|1=es el codigo fuente del algoritmo numeros felices}} |Source=trabajo en clase |Author=Christhiangordillo |Date=2010 |Permission= |other_versions= }} |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
_error | 0 |
---|