Page 3 of 3
Posted: Tue Oct 25, 2011 12:40 pm
by Redman
lamefun wrote:C++ will soon die in favor of better languages developed by Microsoft like C# and other .Net languages! Microsoft will likely develop even better languages!
How is C# better than C++? C# looks like clone of Java language to me.
Posted: Tue Oct 25, 2011 1:08 pm
by Quarko
Redman wrote:lamefun wrote:C++ will soon die in favor of better languages developed by Microsoft like C# and other .Net languages! Microsoft will likely develop even better languages!
How is C# better than C++? C# looks like clone of Java language to me.
With all respect, both C#
and Java are better than C++ in 99% cases. The problem is that 1% where someone still has to know C++.
Posted: Tue Oct 25, 2011 2:29 pm
by lamefun
Quarko wrote:lamefun wrote:C++ will soon die in favor of better languages developed by Microsoft like C# and other .Net languages! Microsoft will likely develop even better languages!
A thing to think about: in what language is .Net framework written?
Do you know about
compiler bootstrapping? I'm sure that even if .Net is in C++ now, it'll soon be in C#.
Posted: Tue Oct 25, 2011 3:09 pm
by Redman
Quarko wrote:Redman wrote:lamefun wrote:C++ will soon die in favor of better languages developed by Microsoft like C# and other .Net languages! Microsoft will likely develop even better languages!
How is C# better than C++? C# looks like clone of Java language to me.
With all respect, both C#
and Java are better than C++ in 99% cases. The problem is that 1% where someone still has to know C++.
Then it's weird that most games, video editors, graphics editors, sound editors, libraries, operating systems and other programs were written in C/C++, not Java or C#.
Posted: Sat Oct 29, 2011 7:57 pm
by Lanac
So, since no one helped much
, i had to learn everything myself and i managed to make a task without anyones help(only one friend told me that for chars is %c, not %d, so i had some weird result ^^), and i wanna share it here, if someone know how does it even work:
Code: Select all
#include <iostream>
#include <stdio>
using namespace std;
int main()
{
int x;
int y=0;
char f,g,h,i,j;
scanf("%d",&x);
scanf(" %c",&f);
scanf(" %c",&g);
scanf(" %c",&h);
scanf(" %c",&i);
scanf(" %c",&j);
int a=x/10000;
x=x%10000;
int b=x/1000;
x=x%1000;
int c=x/100;
x=x%100;
int d=x/10;
x=x%10;
int e=x;
if(f=='D') y=y+a;
if(g=='D') y=y+b;
if(h=='D') y=y+c;
if(i=='D') y=y+d;
if(j=='D') y=y+e;
printf("%d",y);
return 0;
}
I amde it in 30 mins, and i know a skilled programmer would make it in 2 minutes, but im not a pro ^^
Posted: Sat Oct 29, 2011 9:31 pm
by Redman
I think this program was supposed to load a 5-digit integer and set every n-th digit to zero if n-th character is not 'D'. I would do it that way:
Code: Select all
int main()
{
int i,n;
char c[5], ns[6];
scanf("%d %c%c%c%c%c",&x,&c[0],&c[1],&c[2],&c[3],&c[4],&c[5]);
snprintf(ns,6,"%i",n);
for(i=0;i<5;i++)
if(c[i]!='D') ns[i]='0';
printf("%s",ns);
}
Posted: Sat Oct 29, 2011 9:42 pm
by Quarko
Redman wrote:I think this program was supposed to load a 5-digit integer and set every n-th digit to zero if n-th character is not 'D'. I would do it that way:
Code: Select all
int main()
{
int i,n;
char c[5], ns[6];
scanf("%d %c%c%c%c%c",&x,&c[0],&c[1],&c[2],&c[3],&c[4],&c[5]);
snprintf(ns,6,"%i",n);
for(i=0;i<5;i++)
if(c[i]!='D') ns[i]='0';
printf("%s",ns);
}
Wrong. His code does this:
Input: Source 5 digit number (for example: 12345)
Input: Mask of operations (for example: D00D0)
Result: Sum of all digits that correspond to letter 'D' in given mask. Our example: 1 + 4 = 5 (because first letter D corresponds to '1' and last letter D to '4')
Posted: Sun Oct 30, 2011 8:09 am
by Lanac
Quarko wrote:Redman wrote:I think this program was supposed to load a 5-digit integer and set every n-th digit to zero if n-th character is not 'D'. I would do it that way:
Code: Select all
int main()
{
int i,n;
char c[5], ns[6];
scanf("%d %c%c%c%c%c",&x,&c[0],&c[1],&c[2],&c[3],&c[4],&c[5]);
snprintf(ns,6,"%i",n);
for(i=0;i<5;i++)
if(c[i]!='D') ns[i]='0';
printf("%s",ns);
}
Wrong. His code does this:
Input: Source 5 digit number (for example: 12345)
Input: Mask of operations (for example: D00D0)
Result: Sum of all digits that correspond to letter 'D' in given mask. Our example: 1 + 4 = 5 (because first letter D corresponds to '1' and last letter D to '4')
Quarko is right. First input is 5 digit numb, after that its D OR K(d=dugi=long) or K(k=kratki=short). And then make sum of all digits that had D in its position and ignore any other char
Posted: Sun Oct 30, 2011 12:06 pm
by Nod_Nod_Nod
I too made a program, but im not sure if I made any mistakes.
Code: Select all
#include <iostream>
#include <cstdio>
#include <conio>
#include <quarko>
using namespace std;
int main()
{
cout << "Hello World";
cin.ignore;
getchar();
return 0;
}
Buahahhah Hhah haha Lol
Posted: Sun Jun 02, 2013 3:11 pm
by lamefun
I take my words about .NET back, it's now clear that JavaScript is becoming the official programming language of planet Earth! Even GNU/Linux community has adopted it, KDE 5 will be completely inseparable from it and GNOME 3 has already chosen it as the official recommended programming language!
Posted: Sun Jun 02, 2013 4:16 pm
by imp
lamefun wrote:JavaScript is becoming the official programming language of planet Earth!!
I don't think so.
Posted: Tue Jun 04, 2013 4:59 pm
by Pikachu
Personally, I'dd start with something more simple.
this language is a good candidate for beginners.