R Unlimited CZ Forum Index
Donate $5 to get admin level 5 ->    
R Unlimited CZ
FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages


Post new topic  Reply to topic Goto page Previous  1, 2, 3
 C++/C/Pascal/basic/etc... « View previous topic :: View next topic » 
Author Message
Redman
PostPosted: Tue Oct 25, 2011 12:40 pm    Post subject: Reply with quote

Marauder
Marauder

Joined: 03 Apr 2009
Posts: 403
Location: Walbrzych, Poland

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.
Back to top
View user's profile Send private message
Quarko
PostPosted: Tue Oct 25, 2011 1:08 pm    Post subject: Reply with quote

Server supporter
Server supporter

Joined: 22 May 2009
Posts: 1227
Location: Kaunas, Lithuania

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++.
Back to top
View user's profile Send private message
lamefun
PostPosted: Tue Oct 25, 2011 2:29 pm    Post subject: Reply with quote

Dretch
Dretch

Joined: 24 Aug 2011
Posts: 67

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? Very Happy


Do you know about compiler bootstrapping? I'm sure that even if .Net is in C++ now, it'll soon be in C#.
Back to top
View user's profile Send private message
Redman
PostPosted: Tue Oct 25, 2011 3:09 pm    Post subject: Reply with quote

Marauder
Marauder

Joined: 03 Apr 2009
Posts: 403
Location: Walbrzych, Poland

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#.
Back to top
View user's profile Send private message
Lanac
PostPosted: Sat Oct 29, 2011 7:57 pm    Post subject: Reply with quote

Tyrant
Tyrant

Joined: 10 Sep 2010
Posts: 865
Location: Idk...

So, since no one helped much Sad, 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:
#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 ^^
_________________
My Youtube Channel:
Please help my ass and click on link, im a poor bitch...(+ ill make some trem videos too Very Happy)
http://adf.ly/2qaKp
Back to top
View user's profile Send private message Send e-mail
Redman
PostPosted: Sat Oct 29, 2011 9:31 pm    Post subject: Reply with quote

Marauder
Marauder

Joined: 03 Apr 2009
Posts: 403
Location: Walbrzych, Poland

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:
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);
}
Back to top
View user's profile Send private message
Quarko
PostPosted: Sat Oct 29, 2011 9:42 pm    Post subject: Reply with quote

Server supporter
Server supporter

Joined: 22 May 2009
Posts: 1227
Location: Kaunas, Lithuania

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:
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')
Back to top
View user's profile Send private message
Lanac
PostPosted: Sun Oct 30, 2011 8:09 am    Post subject: Reply with quote

Tyrant
Tyrant

Joined: 10 Sep 2010
Posts: 865
Location: Idk...

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:
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 Smile
_________________
My Youtube Channel:
Please help my ass and click on link, im a poor bitch...(+ ill make some trem videos too Very Happy)
http://adf.ly/2qaKp
Back to top
View user's profile Send private message Send e-mail
Nod_Nod_Nod
PostPosted: Sun Oct 30, 2011 12:06 pm    Post subject: Reply with quote

Tyrant
Tyrant

Joined: 14 Mar 2010
Posts: 1079
Location: Poland

I too made a program, but im not sure if I made any mistakes.

Code:
#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
_________________
The nodding of the head once to symbolize a greeting, cuz we white folk to damn lazy to open our mouths and speak up. Nods are also easier to shake off than a flase "hello".
"Person nods at you", or your direction, "you nod back"
Back to top
View user's profile Send private message Visit poster's website
lamefun
PostPosted: Sun Jun 02, 2013 3:11 pm    Post subject: Reply with quote

Dretch
Dretch

Joined: 24 Aug 2011
Posts: 67

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!
Back to top
View user's profile Send private message
imp
PostPosted: Sun Jun 02, 2013 4:16 pm    Post subject: Reply with quote

Basilisk
Basilisk

Joined: 21 Mar 2013
Posts: 299

lamefun wrote:
JavaScript is becoming the official programming language of planet Earth!!

I don't think so.
Back to top
View user's profile Send private message
Pikachu
PostPosted: Tue Jun 04, 2013 4:59 pm    Post subject: Reply with quote

Dretch
Dretch

Joined: 02 May 2013
Posts: 82

Personally, I'dd start with something more simple.
this language is a good candidate for beginners.
_________________
zap zap zap
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2, 3 Page 3 of 3

Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


DAJ Glass (1.0.8) template by Dustin Baccetti
EQ graphic based off of a design from www.freeclipart.nu
Powered by phpBB © 2001, 2005 phpBB Group